# HG changeset patch # User Kenichi Handa # Date 1054797409 0 # Node ID 3e4c75be838356e829ede89d2af3d073411cf8e2 # Parent 1cab1d5a568ec4d4485271cb1b531411067019b7 (read_process_output): Handle carryover correctly. diff -r 1cab1d5a568e -r 3e4c75be8383 src/process.c --- a/src/process.c Mon Jun 02 18:29:17 2003 +0000 +++ b/src/process.c Thu Jun 05 07:16:49 2003 +0000 @@ -3050,10 +3050,12 @@ } } - carryover = nbytes - coding->consumed; - bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data, - carryover); - XSETINT (p->decoding_carryover, carryover); + if (coding->carryover_bytes > 0) + { + bcopy (coding->carryover, XSTRING (p->decoding_buf)->data, + coding->carryover_bytes); + XSETINT (p->decoding_carryover, coding->carryover_bytes); + } nbytes = STRING_BYTES (XSTRING (text)); nchars = XSTRING (text)->size; if (nbytes > 0) @@ -3151,10 +3153,12 @@ proc_encode_coding_system[XINT (p->outfd)]); } } - carryover = nbytes - coding->consumed; - bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data, - carryover); - XSETINT (p->decoding_carryover, carryover); + if (coding->carryover_bytes > 0) + { + bcopy (coding->carryover, XSTRING (p->decoding_buf)->data, + coding->carryover_bytes); + XSETINT (p->decoding_carryover, coding->carryover_bytes); + } /* Adjust the multibyteness of TEXT to that of the buffer. */ if (NILP (current_buffer->enable_multibyte_characters) != ! STRING_MULTIBYTE (text))