From dd8c7a534e3de21370a7741e81c100b0cd743b71 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 5 Jun 2003 07:17:10 +0000 Subject: [PATCH] (read_process_output): Handle carryover correctly. --- src/ChangeLog | 6 +++++- src/process.c | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3cd24eff246..4c07d29c07d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,12 @@ +2003-06-05 Kenichi Handa + + * process.c (read_process_output): Handle carryover correctly. + 2003-06-02 Dave Love * regex.c (re_search_2): Fix last change. -2003-05-30 Kenichi Handa +2003-05-30 Kenichi Handa * regex.c (GET_CHAR_BEFORE_2): Check multibyte, not target_multibyte. Even in a unibyte case, return a converted diff --git a/src/process.c b/src/process.c index 5ca96d83e9c..618e7b577b4 100644 --- a/src/process.c +++ b/src/process.c @@ -3050,10 +3050,12 @@ read_process_output (proc, channel) } } - 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 @@ read_process_output (proc, channel) 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)) -- 2.39.5