aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa1998-08-31 03:50:17 +0000
committerKenichi Handa1998-08-31 03:50:17 +0000
commitd4e57bcd5bedb4868574821064788561819690e7 (patch)
tree89197b81807e8351780eb2e256457d2573dedced /src/coding.c
parente0e25273d2f53f155ca0bd183db9e148f6f3cd6c (diff)
downloademacs-d4e57bcd5bedb4868574821064788561819690e7.tar.gz
emacs-d4e57bcd5bedb4868574821064788561819690e7.zip
(decode_coding): Even if SRC_BYTES is zero, try
processing if CODING requires flushing. (encode_coding): Likewise. (code_convert_region): Likewise. (code_convert_string): Likewise.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/coding.c b/src/coding.c
index 829d8ec1ebd..3d702c4b6f5 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -3651,7 +3651,9 @@ decode_coding (coding, source, destination, src_bytes, dst_bytes)
3651{ 3651{
3652 int result; 3652 int result;
3653 3653
3654 if (src_bytes <= 0) 3654 if (src_bytes <= 0
3655 && ! (coding->mode & CODING_MODE_LAST_BLOCK
3656 && CODING_REQUIRE_FLUSHING (coding)))
3655 { 3657 {
3656 coding->produced = coding->produced_char = 0; 3658 coding->produced = coding->produced_char = 0;
3657 coding->consumed = coding->consumed_char = 0; 3659 coding->consumed = coding->consumed_char = 0;
@@ -3731,7 +3733,9 @@ encode_coding (coding, source, destination, src_bytes, dst_bytes)
3731{ 3733{
3732 int result; 3734 int result;
3733 3735
3734 if (src_bytes <= 0) 3736 if (src_bytes <= 0
3737 && ! (coding->mode & CODING_MODE_LAST_BLOCK
3738 && CODING_REQUIRE_FLUSHING (coding)))
3735 { 3739 {
3736 coding->produced = coding->produced_char = 0; 3740 coding->produced = coding->produced_char = 0;
3737 coding->consumed = coding->consumed_char = 0; 3741 coding->consumed = coding->consumed_char = 0;
@@ -4184,7 +4188,9 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
4184 shrink_encoding_region (&from_byte, &to_byte, coding, NULL); 4188 shrink_encoding_region (&from_byte, &to_byte, coding, NULL);
4185 else 4189 else
4186 shrink_decoding_region (&from_byte, &to_byte, coding, NULL); 4190 shrink_decoding_region (&from_byte, &to_byte, coding, NULL);
4187 if (from_byte == to_byte) 4191 if (from_byte == to_byte
4192 && ! (coding->mode & CODING_MODE_LAST_BLOCK
4193 && CODING_REQUIRE_FLUSHING (coding)))
4188 { 4194 {
4189 coding->produced = len_byte; 4195 coding->produced = len_byte;
4190 coding->produced_char = multibyte ? len : len_byte; 4196 coding->produced_char = multibyte ? len : len_byte;
@@ -4486,7 +4492,9 @@ code_convert_string (str, coding, encodep, nocopy)
4486 else 4492 else
4487 shrink_decoding_region (&from, &to_byte, coding, XSTRING (str)->data); 4493 shrink_decoding_region (&from, &to_byte, coding, XSTRING (str)->data);
4488 } 4494 }
4489 if (from == to_byte) 4495 if (from == to_byte
4496 && ! (coding->mode & CODING_MODE_LAST_BLOCK
4497 && CODING_REQUIRE_FLUSHING (coding)))
4490 return (nocopy ? str : Fcopy_sequence (str)); 4498 return (nocopy ? str : Fcopy_sequence (str));
4491 4499
4492 if (encodep) 4500 if (encodep)