bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fix 'striconv' on NetBSD


From: Bruno Haible
Subject: fix 'striconv' on NetBSD
Date: Wed, 25 Oct 2006 14:13:45 +0200
User-agent: KMail/1.9.1

Hi,

NetBSD has an iconv() with a similar behaviour as Irix iconv().  I'm
applying this patch. It has the effect that the 'striconv' functions will
prefer returning a failure code rather than a string full of question marks.
In other words, it will make 'striconv' behave the same way on NetBSD as
on platforms with glibc or libiconv. It fixes a testsuite failure of
GNU gettext.

2006-10-24  Bruno Haible  <address@hidden>

        * lib/striconv.c (mem_cd_iconv, str_cd_iconv): Treat all non-GNU
        iconv implementations like Irix iconv.

*** gnulib-20061020/lib/striconv.c      2006-09-19 00:51:16.000000000 +0200
--- gnulib-20061020-modified/lib/striconv.c     2006-10-25 02:11:27.000000000 
+0200
***************
*** 80,87 ****
            else
              return -1;
          }
! # if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)
!       /* Irix iconv() inserts a NUL byte if it cannot convert.  */
        else if (res > 0)
          {
            errno = EILSEQ;
--- 80,90 ----
            else
              return -1;
          }
! # 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,154 ****
            else
              return -1;
          }
! # if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)
!       /* Irix iconv() inserts a NUL byte if it cannot convert.  */
        else if (res > 0)
          {
            errno = EILSEQ;
--- 150,160 ----
            else
              return -1;
          }
! # 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,295 ****
            else
              goto failed;
          }
! # if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)
!       /* Irix iconv() inserts a NUL byte if it cannot convert.  */
        else if (res > 0)
          {
            errno = EILSEQ;
--- 294,304 ----
            else
              goto failed;
          }
! # 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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]