diff options
| author | Kenichi Handa | 2003-07-31 01:24:44 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-07-31 01:24:44 +0000 |
| commit | e430e5baa09f3451c5d03290b5c51e783a30fd26 (patch) | |
| tree | 0c36d2e0ebae7bc9e4c0f5e99735bace83f4c3fa /src/process.c | |
| parent | 97e7188e573bc75cd99cd5ab14b7291d2451364f (diff) | |
| download | emacs-e430e5baa09f3451c5d03290b5c51e783a30fd26.tar.gz emacs-e430e5baa09f3451c5d03290b5c51e783a30fd26.zip | |
(read_process_output): Return the actually read bytes
instead of the result of decoding.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 11 |
1 files changed, 4 insertions, 7 deletions
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) | |||
| 4571 | text = (STRING_MULTIBYTE (text) | 4571 | text = (STRING_MULTIBYTE (text) |
| 4572 | ? Fstring_as_unibyte (text) | 4572 | ? Fstring_as_unibyte (text) |
| 4573 | : Fstring_to_multibyte (text)); | 4573 | : Fstring_to_multibyte (text)); |
| 4574 | nbytes = SBYTES (text); | 4574 | if (SBYTES (text) > 0) |
| 4575 | nchars = SCHARS (text); | ||
| 4576 | if (nbytes > 0) | ||
| 4577 | internal_condition_case_1 (read_process_output_call, | 4575 | internal_condition_case_1 (read_process_output_call, |
| 4578 | Fcons (outstream, | 4576 | Fcons (outstream, |
| 4579 | Fcons (proc, Fcons (text, Qnil))), | 4577 | Fcons (proc, Fcons (text, Qnil))), |
| @@ -4607,7 +4605,7 @@ read_process_output (proc, channel) | |||
| 4607 | start_vms_process_read (vs); | 4605 | start_vms_process_read (vs); |
| 4608 | #endif | 4606 | #endif |
| 4609 | unbind_to (count, Qnil); | 4607 | unbind_to (count, Qnil); |
| 4610 | return nchars; | 4608 | return nbytes; |
| 4611 | } | 4609 | } |
| 4612 | 4610 | ||
| 4613 | /* If no filter, write into buffer if it isn't dead. */ | 4611 | /* If no filter, write into buffer if it isn't dead. */ |
| @@ -4678,11 +4676,10 @@ read_process_output (proc, channel) | |||
| 4678 | text = (STRING_MULTIBYTE (text) | 4676 | text = (STRING_MULTIBYTE (text) |
| 4679 | ? Fstring_as_unibyte (text) | 4677 | ? Fstring_as_unibyte (text) |
| 4680 | : Fstring_to_multibyte (text)); | 4678 | : Fstring_to_multibyte (text)); |
| 4681 | nbytes = SBYTES (text); | ||
| 4682 | nchars = SCHARS (text); | ||
| 4683 | /* Insert before markers in case we are inserting where | 4679 | /* Insert before markers in case we are inserting where |
| 4684 | the buffer's mark is, and the user's next command is Meta-y. */ | 4680 | the buffer's mark is, and the user's next command is Meta-y. */ |
| 4685 | insert_from_string_before_markers (text, 0, 0, nchars, nbytes, 0); | 4681 | insert_from_string_before_markers (text, 0, 0, |
| 4682 | SCHARS (text), SBYTES (text), 0); | ||
| 4686 | 4683 | ||
| 4687 | /* Make sure the process marker's position is valid when the | 4684 | /* Make sure the process marker's position is valid when the |
| 4688 | process buffer is changed in the signal_after_change above. | 4685 | process buffer is changed in the signal_after_change above. |