This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
make tst-table-to more robust
- From: Bruno Haible <bruno at clisp dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 13 May 2002 15:18:15 +0200 (CEST)
- Subject: make tst-table-to more robust
My last patch to tst-table-to.c, for encodings with shift state, doesn't
treat encodings with transliteration right. (If the return value of the
seconf iconv call is > 0, the return value from the third call - usually
zero - will overwrite it.) Here is a fix.
2002-05-12 Bruno Haible <bruno@clisp.org>
* iconvdata/tst-table-to.c (main): Restore handling of
transliterations, broken by last patch.
--- glibc-20020425/iconvdata/tst-table-to.c.bak 2002-04-22 13:50:35.000000000 +0200
+++ glibc-20020425/iconvdata/tst-table-to.c 2002-05-12 00:00:19.000000000 +0200
@@ -77,15 +77,16 @@
char *outbuf = (char *) buf;
size_t outbytesleft = sizeof (buf);
size_t result;
+ size_t result2 = 0;
iconv (cd, NULL, NULL, NULL, NULL);
result = iconv (cd,
(char **) &inbuf, &inbytesleft,
&outbuf, &outbytesleft);
if (result != (size_t)(-1))
- result = iconv (cd, NULL, NULL, &outbuf, &outbytesleft);
+ result2 = iconv (cd, NULL, NULL, &outbuf, &outbytesleft);
- if (result == (size_t)(-1))
+ if (result == (size_t)(-1) || result2 == (size_t)(-1))
{
if (errno != EILSEQ)
{