summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2003-06-05 07:17:10 +0000
committerKenichi Handa <handa@m17n.org>2003-06-05 07:17:10 +0000
commitdd8c7a534e3de21370a7741e81c100b0cd743b71 (patch)
tree45adb0c76460c8b173a5b242d2be4c8617063c6c
parentb884eb4db2584372fce1d777fdf2cf8f7ff27e04 (diff)
downloademacs-dd8c7a534e3de21370a7741e81c100b0cd743b71.tar.gz
(read_process_output): Handle carryover correctly.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/process.c20
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 <handa@m17n.org>
+
+ * process.c (read_process_output): Handle carryover correctly.
+
2003-06-02 Dave Love <fx@gnu.org>
* regex.c (re_search_2): Fix last change.
-2003-05-30 Kenichi Handa <handa@etlken2>
+2003-05-30 Kenichi Handa <handa@m17n.org>
* 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))