# HG changeset patch # User Kenichi Handa # Date 870399380 0 # Node ID 36b06087dc31f0115f1d942173b463e2c1f6c7e6 # Parent 299ae0a2c4fd1a20ea2e0237542e16270793f584 (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. diff -r 299ae0a2c4fd -r 36b06087dc31 src/coding.c --- a/src/coding.c Fri Aug 01 01:36:20 1997 +0000 +++ b/src/coding.c Fri Aug 01 01:36:20 1997 +0000 @@ -1563,8 +1563,11 @@ } 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 @@ 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 @@ { int produced; - coding->carryover_size = 0; switch (coding->type) { case coding_type_no_conversion: