From: Paul Eggert Date: Mon, 4 Apr 2011 09:06:52 +0000 (-0700) Subject: * process.c (read_process_output): Simplify nbytes computation if buffered. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~394^2~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe07cdfa53cf14415f9c7847d9e6af6747e5023c;p=emacs.git * process.c (read_process_output): Simplify nbytes computation if buffered. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6c28e61a718..0716233d612 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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. diff --git a/src/process.c b/src/process.c index 33f41c4a8f0..a9a8eb79ede 100644 --- a/src/process.c +++ b/src/process.c @@ -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;