]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Work around localcharset issue under OS X multi-threaded scenario.
authorDaiki Ueno <ueno@gnu.org>
Tue, 25 Jun 2013 02:56:09 +0000 (11:56 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 25 Jun 2013 03:00:59 +0000 (12:00 +0900)
* lib/localcharset.c.diff: New patch originally posted to Gnulib
<https://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00091.html>.

gnulib-local/ChangeLog
gnulib-local/lib/localcharset.c.diff [new file with mode: 0644]

index eb99087ba1e0ea5c67d51e079cd3e27d84df3aa3..726f300b54e28fd6b9c3358f2f89358654857ed6 100644 (file)
@@ -1,3 +1,9 @@
+2013-06-25  Daiki Ueno  <ueno@gnu.org>
+
+       Work around localcharset issue under OS X multi-threaded scenario.
+       * lib/localcharset.c.diff: New patch originally posted to Gnulib
+       <https://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00091.html>.
+
 2013-06-16  Andreas Schwab  <schwab@linux-m68k.org>  (tiny change)
 
        * m4/libxml.m4 (gl_LIBXML): Remove extra quotes.
diff --git a/gnulib-local/lib/localcharset.c.diff b/gnulib-local/lib/localcharset.c.diff
new file mode 100644 (file)
index 0000000..088c37c
--- /dev/null
@@ -0,0 +1,25 @@
+diff --git a/localcharset.c b/localcharset.c
+index 6b0153e..bfd9a03 100644
+--- a/localcharset.c
++++ b/localcharset.c
+@@ -65,6 +65,11 @@
+ # include <os2.h>
+ #endif
++/* For MB_CUR_MAX_L */
++#if defined DARWIN7
++# include <xlocale.h>
++#endif
++
+ #if ENABLE_RELOCATABLE
+ # include "relocatable.h"
+ #else
+@@ -545,7 +550,7 @@ locale_charset (void)
+ #ifdef DARWIN7
+   /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
+      (the default codeset) does not work when MB_CUR_MAX is 1.  */
+-  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX <= 1)
++  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
+     codeset = "ASCII";
+ #endif