From e430e5baa09f3451c5d03290b5c51e783a30fd26 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 31 Jul 2003 01:24:44 +0000 Subject: [PATCH] (read_process_output): Return the actually read bytes instead of the result of decoding. --- src/ChangeLog | 5 +++++ src/process.c | 11 ++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 420c9f6c0f6..71f2ff865f8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-07-31 Kenichi Handa + + * process.c (read_process_output): Return the actually read bytes + instead of the result of decoding. + 2003-07-31 Kenichi Handa * xterm.h (struct x_bitmap_record): New member have_mask. diff --git a/src/process.c b/src/process.c index 8fac99570cc..c4ba96a9e5c 100644 --- a/src/process.c +++ b/src/process.c @@ -4571,9 +4571,7 @@ read_process_output (proc, channel) text = (STRING_MULTIBYTE (text) ? Fstring_as_unibyte (text) : Fstring_to_multibyte (text)); - nbytes = SBYTES (text); - nchars = SCHARS (text); - if (nbytes > 0) + if (SBYTES (text) > 0) internal_condition_case_1 (read_process_output_call, Fcons (outstream, Fcons (proc, Fcons (text, Qnil))), @@ -4607,7 +4605,7 @@ read_process_output (proc, channel) start_vms_process_read (vs); #endif unbind_to (count, Qnil); - return nchars; + return nbytes; } /* If no filter, write into buffer if it isn't dead. */ @@ -4678,11 +4676,10 @@ read_process_output (proc, channel) text = (STRING_MULTIBYTE (text) ? Fstring_as_unibyte (text) : Fstring_to_multibyte (text)); - nbytes = SBYTES (text); - nchars = SCHARS (text); /* Insert before markers in case we are inserting where the buffer's mark is, and the user's next command is Meta-y. */ - insert_from_string_before_markers (text, 0, 0, nchars, nbytes, 0); + insert_from_string_before_markers (text, 0, 0, + SCHARS (text), SBYTES (text), 0); /* Make sure the process marker's position is valid when the process buffer is changed in the signal_after_change above. -- 2.39.2