aboutsummaryrefslogtreecommitdiff
path: root/iconvdata/unicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/unicode.c')
-rw-r--r--iconvdata/unicode.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/iconvdata/unicode.c b/iconvdata/unicode.c
index 883e7b18da..7f2aca51b4 100644
--- a/iconvdata/unicode.c
+++ b/iconvdata/unicode.c
@@ -151,13 +151,21 @@ gconv_end (struct __gconv_step *data)
\
if (c >= 0x10000) \
{ \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
+ if (! ignore_errors_p ()) \
+ { \
+ /* This is an illegal character. */ \
+ result = __GCONV_ILLEGAL_INPUT; \
+ break; \
+ } \
\
- put16 (outptr, c); \
+ ++*converted; \
+ } \
+ else \
+ { \
+ put16 (outptr, c); \
+ outptr += 2; \
+ } \
\
- outptr += 2; \
inptr += 4; \
}
#define EXTRA_LOOP_DECLS \