From 84f1d29fb1049df3954d8a72eb6066b0938dd5cb Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 23 Feb 2018 11:06:45 -0700 Subject: [PATCH 1/1] locale.c: Fix dangling set of LC_NUMERIC to C In the past, we've kept LC_NUMERIC in the C locale, because so much code relies on the radix character being a dot. 5.27.9 added an enhancement that checks if the current locale already has it be a dot. If so, it's fine to keep the locale in that one. The spot fixed by this commit didn't get updated to account for this change. (I realize that the docs also need to be updated; that will be in a future commit) --- locale.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/locale.c b/locale.c index 32a423f..149cdb1 100644 --- a/locale.c +++ b/locale.c @@ -1354,7 +1354,12 @@ S_new_numeric(pTHX_ const char *newnum) /* Keep LC_NUMERIC in the C locale. This is for XS modules, so they don't * have to worry about the radix being a non-dot. (Core operations that * need the underlying locale change to it temporarily). */ - set_numeric_standard(); + if (PL_numeric_standard) { + set_numeric_radix(0); + } + else { + set_numeric_standard(); + } #endif /* USE_LOCALE_NUMERIC */ -- 1.8.3.1