summaryrefslogtreecommitdiff
path: root/iconvdata/big5hkscs.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/big5hkscs.c')
-rw-r--r--iconvdata/big5hkscs.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/iconvdata/big5hkscs.c b/iconvdata/big5hkscs.c
index 7e1999ec03..09974d5523 100644
--- a/iconvdata/big5hkscs.c
+++ b/iconvdata/big5hkscs.c
@@ -12609,8 +12609,15 @@ static const char from_ucs4_tab14[][2] =
else \
{ \
/* This is illegal. */ \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
+ if (! ignore_errors_p ()) \
+ { \
+ result = __GCONV_ILLEGAL_INPUT; \
+ break; \
+ } \
+ \
+ ++inptr; \
+ ++*converted; \
+ continue; \
} \
\
/* Get the value from the table. */ \
@@ -12620,8 +12627,15 @@ static const char from_ucs4_tab14[][2] =
if (ch == 0 && *inptr != '\0') \
{ \
/* This is an illegal character. */ \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
+ if (! ignore_errors_p ()) \
+ { \
+ result = __GCONV_ILLEGAL_INPUT; \
+ break; \
+ } \
+ \
+ inptr += 2; \
+ ++*converted; \
+ continue; \
} \
\
inptr += 2; \
@@ -12724,21 +12738,29 @@ static const char from_ucs4_tab14[][2] =
if (cp[0] == '\0' && ch != 0) \
{ \
/* Illegal character. */ \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
+ if (! ignore_errors_p ()) \
+ { \
+ result = __GCONV_ILLEGAL_INPUT; \
+ break; \
+ } \
\
- /* See whether there is enough room for the second byte we write. */ \
- if (NEED_LENGTH_TEST && cp[1] != '\0' && outptr + 1 >= outend) \
+ ++*converted; \
+ } \
+ else \
{ \
- /* We have not enough room. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
+ /* See whether there is enough room for the second byte we write. */ \
+ if (NEED_LENGTH_TEST && cp[1] != '\0' && outptr + 1 >= outend) \
+ { \
+ /* We have not enough room. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ \
+ *outptr++ = cp[0]; \
+ if (cp[1] != '\0') \
+ *outptr++ = cp[1]; \
} \
\
- *outptr++ = cp[0]; \
- if (cp[1] != '\0') \
- *outptr++ = cp[1]; \
inptr += 4; \
}
#include <iconv/loop.c>