]> Savannah Git Hosting - gnulib.git/commitdiff
unicodeio: Fix wrong result on NetBSD.
authorBruno Haible <bruno@clisp.org>
Fri, 10 Jul 2020 07:51:52 +0000 (09:51 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 10 Jul 2020 07:51:52 +0000 (09:51 +0200)
* lib/unicodeio.c (unicode_to_mb): Handle question mark fallback
characters also on NetBSD.

ChangeLog
lib/unicodeio.c

index 556fb535255f62872d8e57c9a3398221b578be68..3737892191a2ba5c07474d905a482e66afdd86b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-07-10  Bruno Haible  <bruno@clisp.org>
+
+       unicodeio: Fix wrong result on NetBSD.
+       * lib/unicodeio.c (unicode_to_mb): Handle question mark fallback
+       characters also on NetBSD.
+
 2020-07-09  Bruno Haible  <bruno@clisp.org>
 
        unicodeio: Fix wrong result on Solaris 11.
index 81fe0ddbf97ff93749e98dd930621c20bc694a37..b616e3d61f7fccd624916267f63e3e6e9f0556d0 100644 (file)
@@ -134,9 +134,10 @@ unicode_to_mb (unsigned int code,
 # if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)
           || (res > 0 && code != 0 && outptr - outbuf == 1 && *outbuf == '\0')
 # endif
-          /* Solaris 11 iconv() inserts a '?' if it cannot convert. */
-# if !defined _LIBICONV_VERSION && defined __sun
-          || (res > 0 && code != 0 && outptr - outbuf == 1 && *outbuf == '?')
+          /* NetBSD iconv() and Solaris 11 iconv() insert a '?' if they cannot
+             convert.  */
+# if !defined _LIBICONV_VERSION && (defined __NetBSD__ || defined __sun)
+          || (res > 0 && outptr - outbuf == 1 && *outbuf == '?')
 # endif
          )
         return failure (code, NULL, callback_arg);