diff options
author | Karl Williamson <public@khwilliamson.com> | 2014-02-15 14:26:46 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2014-02-15 15:50:35 -0700 |
commit | a782673dfe49a0ee690389b79c29633fb303cf33 (patch) | |
tree | 11272eeede24ed18d0699faa65b3d61eb3d090bf /locale.c | |
parent | 49c85077ed88f31bd348f1f4811dec2fea887433 (diff) | |
download | perl-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.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 */ |