X-Git-Url: http://git.csclub.uwaterloo.ca/?p=kopensolaris-gnu%2Fglibc.git;a=blobdiff_plain;f=iconvdata%2Fiso_6937-2.c;h=f58ebe4ff5b3378bf62fa85ea21b32b0bfda6942;hp=a688b7c69559e556afecf7393b7794ba16f201e7;hb=941a6b980cac4507d1773c7682064dbad40858e0;hpb=8b536b3b9ae468b3d31d15859b9a0093942310d5 diff --git a/iconvdata/iso_6937-2.c b/iconvdata/iso_6937-2.c index a688b7c695..f58ebe4ff5 100644 --- a/iconvdata/iso_6937-2.c +++ b/iconvdata/iso_6937-2.c @@ -418,8 +418,16 @@ static const char from_ucs4[][2] = if (ch2 < 0x20 || ch2 >= 0x80) \ { \ /* This is illegal. */ \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ + if (! ignore_errors_p ()) \ + { \ + /* This is an illegal character. */ \ + result = __GCONV_ILLEGAL_INPUT; \ + break; \ + } \ + \ + ++inptr; \ + ++*converted; \ + continue; \ } \ \ ch = to_ucs4_comb[ch - 0xc1][ch2 - 0x20]; \ @@ -427,8 +435,16 @@ static const char from_ucs4[][2] = if (ch == 0) \ { \ /* Illegal character. */ \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ + if (! ignore_errors_p ()) \ + { \ + /* This is an illegal character. */ \ + result = __GCONV_ILLEGAL_INPUT; \ + break; \ + } \ + \ + inptr += 2; \ + ++*converted; \ + continue; \ } \ \ inptr += 2; \ @@ -440,8 +456,16 @@ static const char from_ucs4[][2] = if (ch == 0 && *inptr != '\0') \ { \ /* This is an illegal character. */ \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ + if (! ignore_errors_p ()) \ + { \ + /* This is an illegal character. */ \ + result = __GCONV_ILLEGAL_INPUT; \ + break; \ + } \ + \ + ++inptr; \ + ++*converted; \ + continue; \ } \ ++inptr; \ } \ @@ -543,15 +567,30 @@ static const char from_ucs4[][2] = if (fail) \ { \ /* Illegal characters. */ \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ + if (! ignore_errors_p ()) \ + { \ + /* This is an illegal character. */ \ + result = __GCONV_ILLEGAL_INPUT; \ + break; \ + } \ + \ + inptr += 4; \ + ++*converted; \ + continue; \ } \ } \ else if (from_ucs4[ch][0] == '\0' && ch != 0) \ { \ /* Illegal characters. */ \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ + if (! ignore_errors_p ()) \ + { \ + result = __GCONV_ILLEGAL_INPUT; \ + break; \ + } \ + \ + ++*converted; \ + inptr += 4; \ + continue; \ } \ else \ cp = from_ucs4[ch]; \ @@ -563,6 +602,7 @@ static const char from_ucs4[][2] = if (NEED_LENGTH_TEST && outptr >= outend) \ { \ /* The result does not fit into the buffer. */ \ + --outptr; \ result = __GCONV_FULL_OUTPUT; \ break; \ } \