* process.c (read_process_output): Simplify nbytes computation if buffered.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Apr 2011 09:06:52 +0000 (02:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Apr 2011 09:06:52 +0000 (02:06 -0700)
src/ChangeLog
src/process.c

index 6c28e61..0716233 100644 (file)
@@ -5,6 +5,7 @@
        (create_pty): Remove unnecessary "volatile"s.
        (Fnetwork_interface_info): Avoid possibility of int overflow.
        (read_process_output): Do adaptive read buffering even if carryover.
+       (read_process_output): Simplify nbytes computation if buffered.
 
        * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
 
index 33f41c4..a9a8eb7 100644 (file)
@@ -5205,13 +5205,8 @@ read_process_output (Lisp_Object proc, register int channel)
            }
        }
 #endif
-      if (buffered)
-       {
-         if (nbytes < 0)
-           nbytes = 1;
-         else
-           nbytes = nbytes + 1;
-       }
+      nbytes += buffered;
+      nbytes += buffered && nbytes <= 0;
     }
 
   p->decoding_carryover = 0;