From 692de4b3960dc90bdcfb871513ee4d81d314cf69 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Fri, 15 Jan 2016 11:25:13 -0700 Subject: 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. --- iconvdata/ibm935.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'iconvdata/ibm935.c') 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; \ -- cgit v1.2.3