]> git.eshelyaron.com Git - emacs.git/commitdiff
* 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 6c28e61a7184c431963031b8a103c644ed5dc9b3..0716233d6129e058ef2f0e109dc7d69f6f4c2754 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 33f41c4a8f0bda50e87b8ce30de88ec36cec0104..a9a8eb79edecdf28566aa6376ef1b4c7b3d5d8ae 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;