summaryrefslogtreecommitdiff
path: root/tests/setlocale.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-02 12:05:34 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-02 12:05:34 +0100
commit7c78c92a28ef43d68b172adf97fbd8a27be3baec (patch)
tree3a98b0d01865f5e00912521c58386eb008a70d07 /tests/setlocale.c
parent4d76768442551c97a85e6f133cb818d223012746 (diff)
parent3ee36dc9787cee6ab5314af8f9c01b05a50e7d9d (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tests/setlocale.c')
-rw-r--r--tests/setlocale.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/setlocale.c b/tests/setlocale.c
index 7d366ed..df80890 100644
--- a/tests/setlocale.c
+++ b/tests/setlocale.c
@@ -1,5 +1,5 @@
/* Set the current locale. -*- coding: utf-8 -*-
- Copyright (C) 2009, 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2011-2017 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
@@ -633,6 +633,13 @@ setlocale_unixlike (int category, const char *locale)
char ll_buf[64];
char CC_buf[64];
+ /* The native Windows implementation of setlocale understands the special
+ locale name "C", but not "POSIX". Therefore map "POSIX" to "C". */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ if (locale != NULL && strcmp (locale, "POSIX") == 0)
+ locale = "C";
+#endif
+
/* First, try setlocale with the original argument unchanged. */
result = setlocale (category, locale);
if (result != NULL)