diff options
| author | Kenichi Handa | 2003-06-05 07:17:10 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-06-05 07:17:10 +0000 |
| commit | dd8c7a534e3de21370a7741e81c100b0cd743b71 (patch) | |
| tree | 45adb0c76460c8b173a5b242d2be4c8617063c6c /src/process.c | |
| parent | b884eb4db2584372fce1d777fdf2cf8f7ff27e04 (diff) | |
| download | emacs-dd8c7a534e3de21370a7741e81c100b0cd743b71.tar.gz emacs-dd8c7a534e3de21370a7741e81c100b0cd743b71.zip | |
(read_process_output): Handle carryover correctly.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 20 |
1 files changed, 12 insertions, 8 deletions
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) | |||
| 3050 | } | 3050 | } |
| 3051 | } | 3051 | } |
| 3052 | 3052 | ||
| 3053 | carryover = nbytes - coding->consumed; | 3053 | if (coding->carryover_bytes > 0) |
| 3054 | bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data, | 3054 | { |
| 3055 | carryover); | 3055 | bcopy (coding->carryover, XSTRING (p->decoding_buf)->data, |
| 3056 | XSETINT (p->decoding_carryover, carryover); | 3056 | coding->carryover_bytes); |
| 3057 | XSETINT (p->decoding_carryover, coding->carryover_bytes); | ||
| 3058 | } | ||
| 3057 | nbytes = STRING_BYTES (XSTRING (text)); | 3059 | nbytes = STRING_BYTES (XSTRING (text)); |
| 3058 | nchars = XSTRING (text)->size; | 3060 | nchars = XSTRING (text)->size; |
| 3059 | if (nbytes > 0) | 3061 | if (nbytes > 0) |
| @@ -3151,10 +3153,12 @@ read_process_output (proc, channel) | |||
| 3151 | proc_encode_coding_system[XINT (p->outfd)]); | 3153 | proc_encode_coding_system[XINT (p->outfd)]); |
| 3152 | } | 3154 | } |
| 3153 | } | 3155 | } |
| 3154 | carryover = nbytes - coding->consumed; | 3156 | if (coding->carryover_bytes > 0) |
| 3155 | bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data, | 3157 | { |
| 3156 | carryover); | 3158 | bcopy (coding->carryover, XSTRING (p->decoding_buf)->data, |
| 3157 | XSETINT (p->decoding_carryover, carryover); | 3159 | coding->carryover_bytes); |
| 3160 | XSETINT (p->decoding_carryover, coding->carryover_bytes); | ||
| 3161 | } | ||
| 3158 | /* Adjust the multibyteness of TEXT to that of the buffer. */ | 3162 | /* Adjust the multibyteness of TEXT to that of the buffer. */ |
| 3159 | if (NILP (current_buffer->enable_multibyte_characters) | 3163 | if (NILP (current_buffer->enable_multibyte_characters) |
| 3160 | != ! STRING_MULTIBYTE (text)) | 3164 | != ! STRING_MULTIBYTE (text)) |