summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1998-05-01 04:15:48 +0000
committerKenichi Handa <handa@m17n.org>1998-05-01 04:15:48 +0000
commit49cb52b45cc936795fdfab8a19d22b4b44cecf03 (patch)
tree023e22004d4f5888e778a65b7deb91850e226558 /src/coding.c
parent4eea26a9879a33e7161d00de1d7d367b3148e230 (diff)
(encode_coding_iso2022): If encoding a last block,
reset graphic planes and registers.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/coding.c b/src/coding.c
index f30942e3227..75ef204326d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1946,17 +1946,14 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
break;
}
- if (src < src_end)
- {
- if (result == CODING_FINISH_NORMAL)
- result = CODING_FINISH_INSUFFICIENT_DST;
- else
- /* If this is the last block of the text to be encoded, we
- must reset graphic planes and registers to the initial
- state, and flush out the carryover if any. */
- if (coding->mode & CODING_MODE_LAST_BLOCK)
- ENCODE_RESET_PLANE_AND_REGISTER;
- }
+ if (src < src_end && result == CODING_FINISH_NORMAL)
+ result = CODING_FINISH_INSUFFICIENT_DST;
+
+ /* If this is the last block of the text to be encoded, we must
+ reset graphic planes and registers to the initial state, and
+ flush out the carryover if any. */
+ if (coding->mode & CODING_MODE_LAST_BLOCK)
+ ENCODE_RESET_PLANE_AND_REGISTER;
coding->consumed = src - source;
coding->produced = coding->produced_char = dst - destination;