aboutsummaryrefslogtreecommitdiff
path: root/iconvdata/ibm935.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2016-01-15 11:25:13 -0700
committerMartin Sebor <msebor@redhat.com>2016-01-15 11:25:13 -0700
commit692de4b3960dc90bdcfb871513ee4d81d314cf69 (patch)
tree55f06774f980c8b9e621701a2383df12aa479236 /iconvdata/ibm935.c
parentf2b3078e6a20211233d4971653838e06d048296a (diff)
downloadglibc-692de4b3960dc90bdcfb871513ee4d81d314cf69.tar
glibc-692de4b3960dc90bdcfb871513ee4d81d314cf69.tar.gz
glibc-692de4b3960dc90bdcfb871513ee4d81d314cf69.tar.bz2
glibc-692de4b3960dc90bdcfb871513ee4d81d314cf69.zip
Have iconv accept redundant escape sequences in IBM900, IBM903, IBM905,
IBM907, and IBM909. Patch for bug #17197 changes the encoder to avoid generating redundant shift sequences. However, those sequences may already be present in data encododed by prior versions of the encoder. This change modifies the decoder to also avoid rejecting redundant shift sequences. [BZ #19432] * iconvdata/Makefile: Add bug-iconv11. * iconvdata/bug-iconv11.c: New test. * iconvdata/ibm930.c: Do not reject redundant shift sequences. * iconvdata/ibm933.c: Same. * iconvdata/ibm935.c: Same. * iconvdata/ibm937.c: Same. * iconvdata/ibm939.c: Same.
Diffstat (limited to 'iconvdata/ibm935.c')
-rw-r--r--iconvdata/ibm935.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/iconvdata/ibm935.c b/iconvdata/ibm935.c
index 07f4bf2558..2d3065e54c 100644
--- a/iconvdata/ibm935.c
+++ b/iconvdata/ibm935.c
@@ -109,24 +109,14 @@ enum
\
if (__builtin_expect(ch, 0) == SO) \
{ \
- /* Shift OUT, change to DBCS converter. */ \
- if (curcs == db) \
- { \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
+ /* Shift OUT, change to DBCS converter (redundant escape okay). */ \
curcs = db; \
++inptr; \
continue; \
} \
else if (__builtin_expect (ch, 0) == SI) \
{ \
- /* Shift IN, change to SBCS converter. */ \
- if (curcs == sb) \
- { \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
+ /* Shift IN, change to SBCS converter (redundant escape okay). */ \
curcs = sb; \
++inptr; \
continue; \