From: Bruno Haible Date: Mon, 30 Jan 2012 20:31:57 +0000 (+0100) Subject: wcwidth: Work around bug in UTF-8 locale on OpenBSD 5.0. X-Git-Tag: v0.1~1193 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=21f2ead19f488624d78a0738ee8b75f320696819;p=gnulib.git wcwidth: Work around bug in UTF-8 locale on OpenBSD 5.0. * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Test also wcwidth of U+05B0. * doc/posix-functions/wcwidth.texi: Mention the OpenBSD 5.0 bug. --- diff --git a/ChangeLog b/ChangeLog index 27ef8845c..d3874081d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2012-01-29 Bruno Haible + wcwidth: Work around bug in UTF-8 locale on OpenBSD 5.0. + * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Test also wcwidth of U+05B0. + * doc/posix-functions/wcwidth.texi: Mention the OpenBSD 5.0 bug. + +2012-01-29 Bruno Haible + quotearg: Fix test failure on MacOS X 10.5. * tests/test-quotearg-simple.c: Include localcharset.h. (main): If the locale encoding is not ASCII, bypass the tests of diff --git a/doc/posix-functions/wcwidth.texi b/doc/posix-functions/wcwidth.texi index 11e8eed26..9f4c9b3fd 100644 --- a/doc/posix-functions/wcwidth.texi +++ b/doc/posix-functions/wcwidth.texi @@ -17,7 +17,7 @@ glibc 2.8. @item This function handles combining characters in UTF-8 locales incorrectly on some platforms: -MacOS X 10.3. +MacOS X 10.3, OpenBSD 5.0. @end itemize Portability problems not fixed by Gnulib: diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4 index c54e7cc5c..196c940ed 100644 --- a/m4/wcwidth.m4 +++ b/m4/wcwidth.m4 @@ -1,4 +1,4 @@ -# wcwidth.m4 serial 21 +# wcwidth.m4 serial 22 dnl Copyright (C) 2006-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -37,6 +37,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH], if test $ac_cv_func_wcwidth = yes; then HAVE_WCWIDTH=1 dnl On MacOS 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 This leads to bugs in 'ls' (coreutils). AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales], @@ -69,8 +70,10 @@ int main () { if (wcwidth (0x0301) > 0) result |= 1; - if (wcwidth (0x200B) > 0) + if (wcwidth (0x05B0) > 0) result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; } return result; }]])],