summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-02-15 14:26:46 -0700
committerKarl Williamson <public@khwilliamson.com>2014-02-15 15:50:35 -0700
commita782673dfe49a0ee690389b79c29633fb303cf33 (patch)
tree11272eeede24ed18d0699faa65b3d61eb3d090bf /locale.c
parent49c85077ed88f31bd348f1f4811dec2fea887433 (diff)
downloadperl-a782673dfe49a0ee690389b79c29633fb303cf33.tar.gz
Initialize LC_MESSAGES at start-up
The code did not explicitly iinitialize LC_MESSAGES at startup, unlike most of the other standard categories; I don't know why. This is only an issue for those few platforms without LC_ALL, as that is initialized, and includes LC_MESSAGES. This commit extends the proper initialization to those other platforms.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/locale.c b/locale.c
index e024f35300..e504a8d596 100644
--- a/locale.c
+++ b/locale.c
@@ -516,6 +516,14 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
else
curnum = savepv(curnum);
# endif /* USE_LOCALE_NUMERIC */
+# ifdef USE_LOCALE_MESSAGES
+ if (! my_setlocale(LC_MESSAGES,
+ (!done && (lang || PerlEnv_getenv("LC_MESSAGES")))
+ ? setlocale_init : NULL))
+ {
+ setlocale_failure = TRUE;
+ }
+# endif /* USE_LOCALE_MESSAGES */
}
# endif /* LC_ALL */
@@ -588,6 +596,10 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
else
curnum = savepv(curnum);
#endif /* USE_LOCALE_NUMERIC */
+#ifdef USE_LOCALE_MESSAGES
+ if (! (my_setlocale(LC_MESSAGES, trial_locale)))
+ setlocale_failure = TRUE;
+#endif /* USE_LOCALE_MESSAGES */
if (! setlocale_failure) { /* Success */
break;
}
@@ -621,7 +633,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
if (! curnum)
PerlIO_printf(Perl_error_log, "LC_NUMERIC ");
#endif /* USE_LOCALE_NUMERIC */
- PerlIO_printf(Perl_error_log, "\n");
+ PerlIO_printf(Perl_error_log, "and possibly others\n");
#endif /* LC_ALL */