# HG changeset patch # User Bruno Haible # Date 1157457265 0 # Node ID 58ebe5a656c7b74f661508dfb796be0548a7ebd6 # Parent 02d37bd4003c503f91e20452cc3db76a2b16eb2f (iconv_alloc): Handle the IRIX iconv behaviour. diff --git a/lib/iconvme.c b/lib/iconvme.c --- a/lib/iconvme.c +++ b/lib/iconvme.c @@ -192,6 +192,15 @@ 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 @@ 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';