From f1813b562b7d4aebfde07f0991126e2de7a55d73 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 6 Jan 2001 20:21:33 +0000 Subject: Update. 2001-01-06 Ulrich Drepper * iconv/skeleton.c: Reset outbuf for next round of the loop. Reported by Owen Taylor . * iconv/Makefile (tests): Add tst-iconv3. * iconv/tst-iconv3.c: New file. * iconvdata/ibm930.c: Fix handling of state. Optimize a bit. * iconvdata/ibm933.c: Likewise. * iconvdata/ibm935.c: Likewise. * iconvdata/ibm937.c: Likewise. * iconvdata/ibm939.c: Likewise. * iconvdata/ibm930.h: Adjust single byte table for optimization. * iconvdata/ibm933.h: Likewise. * iconvdata/ibm935.h: Likewise. * iconvdata/ibm939.h: Likewise. * iconvdata/testdata/IBM930: Add misssing SI. * iconvdata/testdata/IBM933: Likewise. * iconvdata/testdata/IBM935: Likewise. * iconvdata/testdata/IBM937: Likewise. * iconvdata/testdata/IBM939: Likewise. * configure.in: Check for old add-ons that shouldn't be used with current glibc anymore. --- iconv/Makefile | 2 +- iconv/skeleton.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'iconv') diff --git a/iconv/Makefile b/iconv/Makefile index 46ce05b..b6c4f23 100644 --- a/iconv/Makefile +++ b/iconv/Makefile @@ -34,7 +34,7 @@ CFLAGS-gconv_db.c = -DSTATIC_GCONV CFLAGS-gconv_simple.c = -DSTATIC_GCONV endif -tests = tst-iconv1 tst-iconv2 +tests = tst-iconv1 tst-iconv2 tst-iconv3 distribute = gconv_builtin.h gconv_int.h loop.c skeleton.c diff --git a/iconv/skeleton.c b/iconv/skeleton.c index 2b080ba..98abc33 100644 --- a/iconv/skeleton.c +++ b/iconv/skeleton.c @@ -1,5 +1,5 @@ /* Skeleton for a conversion module. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -398,7 +398,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data, || (uintptr_t) inptr % MIN_NEEDED_TO != 0))); #endif - do + while (1) { struct __gconv_trans_data *trans; @@ -561,10 +561,18 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data, /* All the output is consumed, we can make another run if everything was ok. */ if (status == __GCONV_FULL_OUTPUT) - status = __GCONV_OK; + { + status = __GCONV_OK; + outbuf = data->__outbuf; + } } + + if (status != __GCONV_OK) + break; + + /* Reset the output buffer pointer for the next round. */ + outbuf = data->__outbuf; } - while (status == __GCONV_OK); #ifdef END_LOOP END_LOOP -- cgit v1.1