aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa1997-08-01 01:36:20 +0000
committerKenichi Handa1997-08-01 01:36:20 +0000
commit76376439f3306a8c6a1dc47121da851e146814f9 (patch)
treec530a6b526f10ea134e31fd79e94cfa92b958436 /src/coding.c
parent8e662997af070e32b49197e0dadc22c60f877549 (diff)
downloademacs-76376439f3306a8c6a1dc47121da851e146814f9.tar.gz
emacs-76376439f3306a8c6a1dc47121da851e146814f9.zip
(encode_coding_iso2022): When source data ends not at
character boundardy, set data in coding->carryover correctly, and set SRC to SRC_END. (encode_coding_sjis_big5): Likewise. (encode_coding): Don't set coding->carryover_size to 0.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/coding.c b/src/coding.c
index 2ebf0a2eade..18c641bcc40 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1563,8 +1563,11 @@ encode_coding_iso2022 (coding, source, destination,
1563 } 1563 }
1564 continue; 1564 continue;
1565 label_end_of_loop: 1565 label_end_of_loop:
1566 coding->carryover_size = src - src_base; 1566 /* We reach here because the source date ends not at character
1567 boundary. */
1568 coding->carryover_size = src_end - src_base;
1567 bcopy (src_base, coding->carryover, coding->carryover_size); 1569 bcopy (src_base, coding->carryover, coding->carryover_size);
1570 src = src_end;
1568 break; 1571 break;
1569 } 1572 }
1570 1573
@@ -1975,9 +1978,9 @@ encode_coding_sjis_big5 (coding, source, destination,
1975 continue; 1978 continue;
1976 1979
1977 label_end_of_loop: 1980 label_end_of_loop:
1978 coding->carryover_size = src - src_base; 1981 coding->carryover_size = src_end - src_base;
1979 bcopy (src_base, coding->carryover, coding->carryover_size); 1982 bcopy (src_base, coding->carryover, coding->carryover_size);
1980 src = src_base; 1983 src = src_end;
1981 break; 1984 break;
1982 } 1985 }
1983 1986
@@ -2802,7 +2805,6 @@ encode_coding (coding, source, destination, src_bytes, dst_bytes, consumed)
2802{ 2805{
2803 int produced; 2806 int produced;
2804 2807
2805 coding->carryover_size = 0;
2806 switch (coding->type) 2808 switch (coding->type)
2807 { 2809 {
2808 case coding_type_no_conversion: 2810 case coding_type_no_conversion: