]> code.delx.au - gnu-emacs/commitdiff
(encode_coding_iso2022): When source data ends not at
authorKenichi Handa <handa@m17n.org>
Fri, 1 Aug 1997 01:36:20 +0000 (01:36 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 1 Aug 1997 01:36:20 +0000 (01:36 +0000)
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.

src/coding.c

index 2ebf0a2eade050406483e50c6f7858f21e03b3fc..18c641bcc409b309aeb10ac9ac82b8f9912b36bf 100644 (file)
@@ -1563,8 +1563,11 @@ encode_coding_iso2022 (coding, source, destination,
        }
       continue;
     label_end_of_loop:
-      coding->carryover_size = src - src_base;
+      /* We reach here because the source date ends not at character
+        boundary.  */
+      coding->carryover_size = src_end - src_base;
       bcopy (src_base, coding->carryover, coding->carryover_size);
+      src = src_end;
       break;
     }
 
@@ -1975,9 +1978,9 @@ encode_coding_sjis_big5 (coding, source, destination,
       continue;
 
     label_end_of_loop:
-      coding->carryover_size = src - src_base;
+      coding->carryover_size = src_end - src_base;
       bcopy (src_base, coding->carryover, coding->carryover_size);
-      src = src_base;
+      src = src_end;
       break;
     }
 
@@ -2802,7 +2805,6 @@ encode_coding (coding, source, destination, src_bytes, dst_bytes, consumed)
 {
   int produced;
 
-  coding->carryover_size = 0;
   switch (coding->type)
     {
     case coding_type_no_conversion: