From 44a3eaeba04ef78835ca741592c376428ada5f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 2 Dec 2017 10:30:25 +0100 Subject: New upstream version 0.9.8 --- tests/setlocale.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/setlocale.c') 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 . */ + along with this program. If not, see . */ /* Written by Bruno Haible , 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) -- cgit v1.2.3