From 14ae15c4ee20a2d1a5aee09fceefc7cf8b1ca333 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 5 Sep 2006 11:54:25 +0000 Subject: [PATCH] (iconv_alloc): Handle the IRIX iconv behaviour. --- lib/iconvme.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/iconvme.c b/lib/iconvme.c index f359e11a84..aa12d24adc 100644 --- a/lib/iconvme.c +++ b/lib/iconvme.c @@ -192,6 +192,15 @@ again: break; } } +# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi) + /* Irix iconv() inserts a NUL byte if it cannot convert. */ + else if (err > 0) + { + errno = EILSEQ; + have_error = 1; + goto out; + } +# endif again2: err = iconv (cd, NULL, NULL, &outp, &outbytes_remaining); @@ -234,6 +243,15 @@ again2: break; } } +# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi) + /* Irix iconv() inserts a NUL byte if it cannot convert. */ + else if (err > 0) + { + errno = EILSEQ; + have_error = 1; + goto out; + } +# endif *outp = '\0'; -- 2.39.5