summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-10-04 20:32:38 -0600
committerKarl Williamson <khw@cpan.org>2022-10-10 13:12:22 -0600
commit885e92041b70376a643f6dacf2202291a4208753 (patch)
tree801c8c1c336925c322da96c9156341027482241c /locale.c
parent6e41334c05484cbb5dbbe855fcac262b943dc628 (diff)
downloadperl-885e92041b70376a643f6dacf2202291a4208753.tar.gz
locale.c: Windows special case NULL input first
This gets the trivial case out of the way, and can use plain setlocale, as the locale string is non-existent, so doesn't need to handle different character sets.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/locale.c b/locale.c
index ac6c11bd88..3c6d42eaac 100644
--- a/locale.c
+++ b/locale.c
@@ -2593,7 +2593,11 @@ S_win32_setlocale(pTHX_ int category, const char* locale)
* variable. */
- if (locale && strEQ(locale, "")) {
+ if (locale == NULL) {
+ return wrap_wsetlocale(category, NULL);
+ }
+
+ if (strEQ(locale, "")) {
/* Note this function may change the locale, but that's ok because we
* are about to change it anyway */
locale = find_locale_from_environment(get_category_index(category, ""));