From f2a8406a4f5974230d33995105160a8bacbce500 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 8 Nov 2007 00:04:24 +0000 Subject: [BZ #5277] 2007-11-07 Ulrich Drepper [BZ #5277] * iconv/loop.c (STANDARD_TO_LOOP_ERR_HANDLER): If conversion failed because output buffer is too small break, don't loop. * iconvdata/Makefile (tests): Add bug-iconv6. * iconvdata/bug-iconv6.c: New file. --- iconv/loop.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'iconv') diff --git a/iconv/loop.c b/iconv/loop.c index 9785bf865c..df8c8dce9f 100644 --- a/iconv/loop.c +++ b/iconv/loop.c @@ -225,7 +225,12 @@ } \ /* If any of them recognized the input continue with the loop. */ \ if (result != __GCONV_ILLEGAL_INPUT) \ - continue; \ + { \ + if (__builtin_expect (result == __GCONV_FULL_OUTPUT, 0)) \ + break; \ + \ + continue; \ + } \ \ /* Next see whether we have to ignore the error. If not, stop. */ \ if (! ignore_errors_p ()) \ -- cgit v1.2.3-70-g09d2