From 0cdb4983fc3d3b97bebf8c466bdef6226b610996 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 25 Aug 2000 22:06:25 +0000 Subject: (ucs4_internal_loop): Don't handle errors when transliterating. (ucs4_internal_loop_unaligned): Likewise. (ucs4le_internal_loop): Likewise. (ucs4le_internal_loop_unaligned): Likewise. --- iconv/gconv_simple.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'iconv/gconv_simple.c') diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c index 019aac2a3f..9376b151ed 100644 --- a/iconv/gconv_simple.c +++ b/iconv/gconv_simple.c @@ -239,6 +239,10 @@ ucs4_internal_loop (struct __gconv_step *step, this is not an error because of the lack of possibilities to represent the result. This is a genuine bug in the input since UCS4 does not allow such values. */ + if (irreversible == NULL) + /* We are transliterating, don't try to correct anything. */ + return __GCONV_ILLEGAL_INPUT; + if (flags & __GCONV_IGNORE_ERRORS) { /* Just ignore this character. */ @@ -292,6 +296,10 @@ ucs4_internal_loop_unaligned (struct __gconv_step *step, this is not an error because of the lack of possibilities to represent the result. This is a genuine bug in the input since UCS4 does not allow such values. */ + if (irreversible == NULL) + /* We are transliterating, don't try to correct anything. */ + return __GCONV_ILLEGAL_INPUT; + if (flags & __GCONV_IGNORE_ERRORS) { /* Just ignore this character. */ @@ -582,6 +590,10 @@ ucs4le_internal_loop (struct __gconv_step *step, this is not an error because of the lack of possibilities to represent the result. This is a genuine bug in the input since UCS4 does not allow such values. */ + if (irreversible == NULL) + /* We are transliterating, don't try to correct anything. */ + return __GCONV_ILLEGAL_INPUT; + if (flags & __GCONV_IGNORE_ERRORS) { /* Just ignore this character. */ @@ -633,6 +645,10 @@ ucs4le_internal_loop_unaligned (struct __gconv_step *step, this is not an error because of the lack of possibilities to represent the result. This is a genuine bug in the input since UCS4 does not allow such values. */ + if (irreversible == NULL) + /* We are transliterating, don't try to correct anything. */ + return __GCONV_ILLEGAL_INPUT; + if (flags & __GCONV_IGNORE_ERRORS) { /* Just ignore this character. */ @@ -958,7 +974,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step, continue; \ } \ \ - if (__builtin_expect (inptr + cnt > inend, 0)) \ + if (__builtin_expect (inptr + cnt > inend, 0)) \ { \ /* We don't have enough input. But before we report that check \ that all the bytes are correct. */ \ @@ -972,7 +988,6 @@ ucs4le_internal_loop_single (struct __gconv_step *step, break; \ } \ \ - /* This is an illegal character. */ \ if (ignore_errors_p ()) \ { \ /* Ignore it. */ \ -- cgit v1.2.3