summaryrefslogtreecommitdiff
path: root/m4/locale-tr.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-10-17 17:23:56 +0200
committerBruno Haible <bruno@clisp.org>2007-10-17 17:23:56 +0200
commit92a8f360080d91e9e1e2be52b7c3704c1ffad1e7 (patch)
tree4ca77dc6e8fa0cf6430bf4bd933fa73ddae9e1ae /m4/locale-tr.m4
parent36b4b80587f78561ee7ba9f0198d0da6ce24f998 (diff)
downloadgnulib-92a8f360080d91e9e1e2be52b7c3704c1ffad1e7.tar.gz
Restrict the usable locale names on Cygwin.
Diffstat (limited to 'm4/locale-tr.m4')
-rw-r--r--m4/locale-tr.m49
1 files changed, 8 insertions, 1 deletions
diff --git a/m4/locale-tr.m4 b/m4/locale-tr.m4
index 2286c181bb..5fce2cfebd 100644
--- a/m4/locale-tr.m4
+++ b/m4/locale-tr.m4
@@ -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 () {
@@ -33,6 +35,11 @@ int main () {
# 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
two bytes long, with UTF-8 encoding. */