# HG changeset patch # User Richard M. Stallman # Date 894321218 0 # Node ID e9014d2166a45a9364e2a27a172d8fe044f2c850 # Parent f4c17bc26d52a3bd8e573edfb948f970a76e8051 (encode_coding_iso2022): Don't skip a code following some invalid code. diff -r f4c17bc26d52 -r e9014d2166a4 src/coding.c --- a/src/coding.c Mon May 04 20:14:36 1998 +0000 +++ b/src/coding.c Mon May 04 22:33:38 1998 +0000 @@ -1868,8 +1868,8 @@ { /* 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 @@ { /* 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 @@ { /* 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 @@ { /* invalid sequence */ *dst++ = c1; - *dst++ = c2; - coding->consumed_char += 2; + src--; + coding->consumed_char++; } else if (c2 == 0xFF) {