projects
/
kopensolaris-gnu
/
glibc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't return error for invald error if ignore flag is set.
[kopensolaris-gnu/glibc.git]
/
iconvdata
/
iso_6937-2.c
diff --git
a/iconvdata/iso_6937-2.c
b/iconvdata/iso_6937-2.c
index
a688b7c
..
f58ebe4
100644
(file)
--- 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. */ \
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]; \
} \
\
ch = to_ucs4_comb[ch - 0xc1][ch2 - 0x20]; \
@@
-427,8
+435,16
@@
static const char from_ucs4[][2] =
if (ch == 0) \
{ \
/* Illegal character. */ \
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; \
} \
\
inptr += 2; \
@@
-440,8
+456,16
@@
static const char from_ucs4[][2] =
if (ch == 0 && *inptr != '\0') \
{ \
/* This is an illegal character. */ \
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; \
} \
} \
++inptr; \
} \
@@
-543,15
+567,30
@@
static const char from_ucs4[][2] =
if (fail) \
{ \
/* Illegal characters. */ \
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. */ \
} \
} \
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]; \
} \
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. */ \
if (NEED_LENGTH_TEST && outptr >= outend) \
{ \
/* The result does not fit into the buffer. */ \
+ --outptr; \
result = __GCONV_FULL_OUTPUT; \
break; \
} \
result = __GCONV_FULL_OUTPUT; \
break; \
} \