Restrict the usable locale names on Cygwin.
authorBruno Haible <bruno@clisp.org>
Wed, 17 Oct 2007 15:23:56 +0000 (17:23 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 17 Oct 2007 15:23:56 +0000 (17:23 +0200)
ChangeLog
m4/locale-fr.m4
m4/locale-tr.m4
m4/locale-zh.m4

index 3336f1bfddadccde4792a34465d686249b020143..ff56f80d67b130836c99ecd0873766391ee7dcc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-17  Bruno Haible  <bruno@clisp.org>
+
+       * m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): On Cygwin, don't
+       allow locale names without encoding suffix.
+       * m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
+       * m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.
+
 2007-10-16  Bruno Haible  <bruno@clisp.org>
 
        * lib/getcwd.c (__getcwd): Define with explicit rpl_ prefix.
index a33f0680dd648ba2e71538b88437a044835cc137..e1ab2543660409359c3b26e078896d7b9854bd7b 100644 (file)
@@ -1,4 +1,4 @@
-# locale-fr.m4 serial 6 (gettext-0.16.2)
+# locale-fr.m4 serial 7 (gettext-0.16.2)
 dnl Copyright (C) 2003, 2005-2007 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,8 @@ changequote(,)dnl
 #if HAVE_LANGINFO_CODESET
 # include <langinfo.h>
 #endif
+#include <stdlib.h>
+#include <string.h>
 struct tm t;
 char buf[16];
 int main () {
@@ -47,6 +49,11 @@ int main () {
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.  */
 #if HAVE_LANGINFO_CODESET
   if (nl_langinfo (CODESET) [0] == '\0') return 1;
+#endif
+#ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names  without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
 #endif
   /* Check whether in the abbreviation of the second month, the second
      character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
@@ -113,6 +120,8 @@ changequote(,)dnl
 #if HAVE_LANGINFO_CODESET
 # include <langinfo.h>
 #endif
+#include <stdlib.h>
+#include <string.h>
 struct tm t;
 char buf[16];
 int main () {
@@ -127,6 +136,11 @@ int main () {
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.  */
 # if HAVE_LANGINFO_CODESET
   if (nl_langinfo (CODESET) [0] == '\0') return 1;
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names  without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
 # endif
   /* Check whether in the abbreviation of the second month, the second
      character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
index 2286c181bb008f47487c3caf97f22875554550dd..5fce2cfebd93e94f8360611603d3f572fada212d 100644 (file)
@@ -1,4 +1,4 @@
-# locale-tr.m4 serial 2
+# locale-tr.m4 serial 3
 dnl Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,6 +18,8 @@ changequote(,)dnl
 #if HAVE_LANGINFO_CODESET
 # include <langinfo.h>
 #endif
+#include <stdlib.h>
+#include <string.h>
 struct tm t;
 char buf[16];
 int main () {
@@ -32,6 +34,11 @@ int main () {
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.  */
 # if HAVE_LANGINFO_CODESET
   if (nl_langinfo (CODESET) [0] == '\0') return 1;
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names  without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
 # endif
   /* Check whether in the abbreviation of the eighth month, the second
      character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is
index 187ad3510549da4d9597ebbf03b3c73830991421..ceff55bc4c642bb1a1e64041b00d667f02da85f0 100644 (file)
@@ -1,4 +1,4 @@
-# locale-zh.m4 serial 2
+# locale-zh.m4 serial 3
 dnl Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -38,6 +38,8 @@ changequote(,)dnl
 #if HAVE_LANGINFO_CODESET
 # include <langinfo.h>
 #endif
+#include <stdlib.h>
+#include <string.h>
 struct tm t;
 char buf[16];
 int main ()
@@ -50,6 +52,11 @@ int main ()
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.  */
 #if HAVE_LANGINFO_CODESET
   if (nl_langinfo (CODESET) [0] == '\0') return 1;
+#endif
+#ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names  without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
 #endif
   /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
      This excludes the UTF-8 encoding.  */