mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
(C_STRTOD): Set LC_ALL to "C", not just LC_NUMERIC, to avoid the
unlikely possibility of mixed locales screwing things up.
This commit is contained in:
1 parent
0e0adc6325
commit
248313ef6a
1 file changed
+3
-3
+3
-3
@@ -59,19 +59,19 @@ C_STRTOD (char const *nptr, char **endptr)
|
||||
|
||||
#else
|
||||
|
||||
char *saved_locale = setlocale (LC_NUMERIC, NULL);
|
||||
char *saved_locale = setlocale (LC_ALL, NULL);
|
||||
|
||||
if (saved_locale)
|
||||
{
|
||||
saved_locale = xstrdup (saved_locale);
|
||||
setlocale (LC_NUMERIC, "C");
|
||||
setlocale (LC_ALL, "C");
|
||||
}
|
||||
|
||||
r = STRTOD (nptr, endptr);
|
||||
|
||||
if (saved_locale)
|
||||
{
|
||||
setlocale (LC_NUMERIC, saved_locale);
|
||||
setlocale (LC_ALL, saved_locale);
|
||||
free (saved_locale);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user