summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-12-16 22:34:19 -0700
committerKarl Williamson <public@khwilliamson.com>2014-01-04 13:33:05 -0700
commita2287a13f4e99299ebd9c06f9f98e1bdc7f5089e (patch)
tree5eb6aa123ff733760028e7a630db5fee6fb8b2bb /pp_ctl.c
parent8a11fac97cbf1b0668b5ba645f1fb2709d10f82a (diff)
downloadperl-a2287a13f4e99299ebd9c06f9f98e1bdc7f5089e.tar.gz
Use new macros to make sure LC_NUMERIC is correctly set
This uses the macros added in the previous commit to make sure the current LC_NUMERIC locale is correct during the operation being done; restoring it to its prior condition afterwards. Outside of 'use locale' the locale should be C; inside it should be the underlying default locale. The macros handle the whole thing. In most of the places here, the code was trying to do what the macros do more elegantly, but there are some additional places where we set the locale correctly around an operation that is affected by it.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 7236921455..d47e983d56 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -836,13 +836,13 @@ PP(pp_formline)
}
/* Formats aren't yet marked for locales, so assume "yes". */
{
- STORE_NUMERIC_STANDARD_SET_LOCAL();
+ DECLARE_STORE_LC_NUMERIC_SET_TO_NEEDED();
arg &= ~(FORM_NUM_POINT|FORM_NUM_BLANK);
/* we generate fmt ourselves so it is safe */
GCC_DIAG_IGNORE(-Wformat-nonliteral);
my_snprintf(t, SvLEN(PL_formtarget) - (t - SvPVX(PL_formtarget)), fmt, (int) fieldsize, (int) arg, value);
GCC_DIAG_RESTORE;
- RESTORE_NUMERIC_STANDARD();
+ RESTORE_LC_NUMERIC();
}
t += fieldsize;
break;