diff options
author | Kenichi Handa <handa@m17n.org> | 1997-08-01 01:36:20 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 1997-08-01 01:36:20 +0000 |
commit | dbc7e4eb5ec334085776c22366f0e3ded3cceeb2 (patch) | |
tree | b899a0d6418a2cce722135b1a251b94a4bfc3485 /src/coding.c | |
parent | 40e5d5df3f2ce2c781e478486b1b94b5f673da47 (diff) | |
download | emacs-dbc7e4eb5ec334085776c22366f0e3ded3cceeb2.tar.gz |
(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.c | 10 |
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, } 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: |