summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-02-15 14:31:11 -0700
committerKarl Williamson <public@khwilliamson.com>2014-02-15 15:50:35 -0700
commitc835d6be1e0eea17f47fce50f2a00877041e96b3 (patch)
tree4a102e505cafa93396f062dcf5f751c75876da8a /locale.c
parenta782673dfe49a0ee690389b79c29633fb303cf33 (diff)
downloadperl-c835d6be1e0eea17f47fce50f2a00877041e96b3.tar.gz
Make sure LC_MONETARY is initialized
This is only an issue for those few platforms without LC_ALL, as that is initialized, and includes LC_MONETARY. This commit extends the proper initialization to those other platforms. Perl doesn't use LC_MONETARY itself, but it should be properly initialized for modules that do.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/locale.c b/locale.c
index e504a8d596..bf55d04441 100644
--- a/locale.c
+++ b/locale.c
@@ -524,6 +524,14 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
setlocale_failure = TRUE;
}
# endif /* USE_LOCALE_MESSAGES */
+# ifdef USE_LOCALE_MONETARY
+ if (! my_setlocale(LC_MONETARY,
+ (!done && (lang || PerlEnv_getenv("LC_MONETARY")))
+ ? setlocale_init : NULL))
+ {
+ setlocale_failure = TRUE;
+ }
+# endif /* USE_LOCALE_MONETARY */
}
# endif /* LC_ALL */
@@ -600,6 +608,11 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
if (! (my_setlocale(LC_MESSAGES, trial_locale)))
setlocale_failure = TRUE;
#endif /* USE_LOCALE_MESSAGES */
+#ifdef USE_LOCALE_MONETARY
+ if (! (my_setlocale(LC_MONETARY, trial_locale)))
+ setlocale_failure = TRUE;
+#endif /* USE_LOCALE_MONETARY */
+
if (! setlocale_failure) { /* Success */
break;
}