summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-05-04 22:33:38 +0000
committerRichard M. Stallman <rms@gnu.org>1998-05-04 22:33:38 +0000
commit38cf95df42408406f3ed33938eb0ecaeb39507fe (patch)
tree56801da3fef6df436625375a3f33c697008157a0
parent490fe8b05c2530a4bfa512d6e7e5a68e742a2fcd (diff)
downloademacs-38cf95df42408406f3ed33938eb0ecaeb39507fe.tar.gz
(encode_coding_iso2022): Don't skip a code following some invalid code.
-rw-r--r--src/coding.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/coding.c b/src/coding.c
index 75ef204326d..fff9292a850 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1868,8 +1868,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
{
/* invalid sequence */
*dst++ = c1;
- *dst++ = c2;
- coding->consumed_char += 2;
+ src--;
+ coding->consumed_char++;
}
else
ENCODE_ISO_CHARACTER (c1, c2, /* dummy */ c3);
@@ -1881,9 +1881,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
{
/* invalid sequence */
*dst++ = c1;
- *dst++ = c2;
- *dst++ = c3;
- coding->consumed_char += 3;
+ src -= 2;
+ coding->consumed_char++;
}
else if (c1 < LEADING_CODE_PRIVATE_11)
ENCODE_ISO_CHARACTER (c1, c2, c3);
@@ -1897,10 +1896,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
{
/* invalid sequence */
*dst++ = c1;
- *dst++ = c2;
- *dst++ = c3;
- *dst++ = c4;
- coding->consumed_char += 4;
+ src -= 3;
+ coding->consumed_char++;
}
else
ENCODE_ISO_CHARACTER (c2, c3, c4);
@@ -1912,8 +1909,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
{
/* invalid sequence */
*dst++ = c1;
- *dst++ = c2;
- coding->consumed_char += 2;
+ src--;
+ coding->consumed_char++;
}
else if (c2 == 0xFF)
{