summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-07-07 14:30:59 -0600
committerKarl Williamson <khw@cpan.org>2014-07-09 08:04:53 -0600
commit126aedc49bc9cee9fc4dc22101aeb9f422ca8cc2 (patch)
tree0c409a14797f97362cfde726f107725b62415a51 /locale.c
parenta39edc4c877304d4075679b1d8de1904671a9c37 (diff)
downloadperl-126aedc49bc9cee9fc4dc22101aeb9f422ca8cc2.tar.gz
locale.c: Keep better track of C/non-C locale
Perl uses three interpreter-level (but private) variables to keep track of numeric locales. PL_numeric name is the current underlying locale. PL_standard is a boolean to indicate if we are switched to the C (or POSIX) locale, and PL_local is a boolean to indicate if we are switched to the underlying one. The reason there are two booleans is if the underlying locale is C, both can be true at the same time. But the code that is being changed by this commit didn't realize this, and could unnecessarily set the booleans to FALSE. This could cause unnecessary switching of locales.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/locale.c b/locale.c
index 332be8a25e..c305747b72 100644
--- a/locale.c
+++ b/locale.c
@@ -218,7 +218,7 @@ Perl_set_numeric_standard(pTHX)
if (_NOT_IN_NUMERIC_STANDARD) {
setlocale(LC_NUMERIC, "C");
PL_numeric_standard = TRUE;
- PL_numeric_local = FALSE;
+ PL_numeric_local = isNAME_C_OR_POSIX(PL_numeric_name);
set_numeric_radix();
}
DEBUG_L(PerlIO_printf(Perl_debug_log,
@@ -237,7 +237,7 @@ Perl_set_numeric_local(pTHX)
if (_NOT_IN_NUMERIC_LOCAL) {
setlocale(LC_NUMERIC, PL_numeric_name);
- PL_numeric_standard = FALSE;
+ PL_numeric_standard = isNAME_C_OR_POSIX(PL_numeric_name);
PL_numeric_local = TRUE;
set_numeric_radix();
}