diff options
| author | Richard M. Stallman | 1998-05-04 22:33:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-04 22:33:38 +0000 |
| commit | 38cf95df42408406f3ed33938eb0ecaeb39507fe (patch) | |
| tree | 56801da3fef6df436625375a3f33c697008157a0 | |
| parent | 490fe8b05c2530a4bfa512d6e7e5a68e742a2fcd (diff) | |
| download | emacs-38cf95df42408406f3ed33938eb0ecaeb39507fe.tar.gz emacs-38cf95df42408406f3ed33938eb0ecaeb39507fe.zip | |
(encode_coding_iso2022): Don't skip a code following some invalid code.
| -rw-r--r-- | src/coding.c | 19 |
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) | |||
| 1868 | { | 1868 | { |
| 1869 | /* invalid sequence */ | 1869 | /* invalid sequence */ |
| 1870 | *dst++ = c1; | 1870 | *dst++ = c1; |
| 1871 | *dst++ = c2; | 1871 | src--; |
| 1872 | coding->consumed_char += 2; | 1872 | coding->consumed_char++; |
| 1873 | } | 1873 | } |
| 1874 | else | 1874 | else |
| 1875 | ENCODE_ISO_CHARACTER (c1, c2, /* dummy */ c3); | 1875 | ENCODE_ISO_CHARACTER (c1, c2, /* dummy */ c3); |
| @@ -1881,9 +1881,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) | |||
| 1881 | { | 1881 | { |
| 1882 | /* invalid sequence */ | 1882 | /* invalid sequence */ |
| 1883 | *dst++ = c1; | 1883 | *dst++ = c1; |
| 1884 | *dst++ = c2; | 1884 | src -= 2; |
| 1885 | *dst++ = c3; | 1885 | coding->consumed_char++; |
| 1886 | coding->consumed_char += 3; | ||
| 1887 | } | 1886 | } |
| 1888 | else if (c1 < LEADING_CODE_PRIVATE_11) | 1887 | else if (c1 < LEADING_CODE_PRIVATE_11) |
| 1889 | ENCODE_ISO_CHARACTER (c1, c2, c3); | 1888 | ENCODE_ISO_CHARACTER (c1, c2, c3); |
| @@ -1897,10 +1896,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) | |||
| 1897 | { | 1896 | { |
| 1898 | /* invalid sequence */ | 1897 | /* invalid sequence */ |
| 1899 | *dst++ = c1; | 1898 | *dst++ = c1; |
| 1900 | *dst++ = c2; | 1899 | src -= 3; |
| 1901 | *dst++ = c3; | 1900 | coding->consumed_char++; |
| 1902 | *dst++ = c4; | ||
| 1903 | coding->consumed_char += 4; | ||
| 1904 | } | 1901 | } |
| 1905 | else | 1902 | else |
| 1906 | ENCODE_ISO_CHARACTER (c2, c3, c4); | 1903 | ENCODE_ISO_CHARACTER (c2, c3, c4); |
| @@ -1912,8 +1909,8 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) | |||
| 1912 | { | 1909 | { |
| 1913 | /* invalid sequence */ | 1910 | /* invalid sequence */ |
| 1914 | *dst++ = c1; | 1911 | *dst++ = c1; |
| 1915 | *dst++ = c2; | 1912 | src--; |
| 1916 | coding->consumed_char += 2; | 1913 | coding->consumed_char++; |
| 1917 | } | 1914 | } |
| 1918 | else if (c2 == 0xFF) | 1915 | else if (c2 == 0xFF) |
| 1919 | { | 1916 | { |