changeset 37903:2793eb7b9c3c

wcwidth: Replace also on OpenBSD 5.8 * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Check the value of wcwidth(0xFF1A). * doc/posix-functions/wcwidth.texi: Update.
author Bruno Haible <bruno@clisp.org>
date Thu, 21 Jan 2016 11:32:20 +0100
parents 6d3f6668d3b7
children f7581cd5fee2
files ChangeLog doc/posix-functions/wcwidth.texi m4/wcwidth.m4
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jan 20 16:17:35 2016 -0800
+++ b/ChangeLog	Thu Jan 21 11:32:20 2016 +0100
@@ -1,3 +1,9 @@
+2016-01-21  Bruno Haible  <bruno@clisp.org>
+
+	wcwidth: Replace also on OpenBSD 5.8
+	* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Check the value of wcwidth(0xFF1A).
+	* doc/posix-functions/wcwidth.texi: Update.
+
 2016-01-20  Pádraig Brady  <P@draigBrady.com>
 
 	gnu-web-doc-update: fix addition of new files
--- a/doc/posix-functions/wcwidth.texi	Wed Jan 20 16:17:35 2016 -0800
+++ b/doc/posix-functions/wcwidth.texi	Thu Jan 21 11:32:20 2016 +0100
@@ -17,7 +17,7 @@
 @item
 This function handles combining characters in UTF-8 locales incorrectly on some
 platforms:
-Mac OS X 10.3, OpenBSD 5.0.
+Mac OS X 10.3, OpenBSD 5.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/m4/wcwidth.m4	Wed Jan 20 16:17:35 2016 -0800
+++ b/m4/wcwidth.m4	Thu Jan 21 11:32:20 2016 +0100
@@ -39,6 +39,7 @@
     dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1.
     dnl On OpenBSD 5.0, wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1.
     dnl On OSF/1 5.1, wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1.
+    dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0.
     dnl This leads to bugs in 'ls' (coreutils).
     AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales],
       [gl_cv_func_wcwidth_works],
@@ -74,6 +75,8 @@
         result |= 2;
       if (wcwidth (0x200B) > 0)
         result |= 4;
+      if (wcwidth (0xFF1A) == 0)
+        result |= 8;
     }
   return result;
 }]])],