From 0a459e96114987ee4ffe3f1a8c600e6ff35a65c1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 25 Oct 2006 11:42:18 +0000 Subject: [PATCH] Treat all non-GNU iconv implementations like Irix iconv. --- ChangeLog | 5 +++++ lib/striconv.c | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6380bbec..58f53df65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-10-24 Bruno Haible + + * lib/striconv.c (mem_cd_iconv, str_cd_iconv): Treat all non-GNU + iconv implementations like Irix iconv. + 2006-10-24 Paul Eggert * modules/vararrays: New file. diff --git a/lib/striconv.c b/lib/striconv.c index c97d5a0c1..fc0224935 100644 --- a/lib/striconv.c +++ b/lib/striconv.c @@ -80,8 +80,11 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd, else return -1; } -# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi) - /* Irix iconv() inserts a NUL byte if it cannot convert. */ +# if !defined _LIBICONV_VERSION && !defined __GLIBC__ + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. */ else if (res > 0) { errno = EILSEQ; @@ -147,8 +150,11 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd, else return -1; } -# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi) - /* Irix iconv() inserts a NUL byte if it cannot convert. */ +# if !defined _LIBICONV_VERSION && !defined __GLIBC__ + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. */ else if (res > 0) { errno = EILSEQ; @@ -288,8 +294,11 @@ str_cd_iconv (const char *src, iconv_t cd) else goto failed; } -# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi) - /* Irix iconv() inserts a NUL byte if it cannot convert. */ +# if !defined _LIBICONV_VERSION && !defined __GLIBC__ + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. */ else if (res > 0) { errno = EILSEQ; -- 2.11.0