Paul Eggert <[EMAIL PROTECTED]> wrote:
> Jim Meyering <[EMAIL PROTECTED]> writes:
>
>> Wouldn't it be better (in case xstrtod is called with a
>> modified LC_NUMERIC locale) if c_strtod restored the original
>> setting for LC_NUMERIC, rather than the environment-derived one?
>
> I was lazy and assumed that c_strtod would be called
> only in environments where LC_NUMERIC was set from the
> environment.
...
> Maybe this instead?
>
> double r;
> char *saved_locale = setlocale (LC_NUMERIC, NULL);
>
> if (saved_locale)
>   {
>     saved_locale = xstrdup (saved_locale);
>     setlocale (LC_NUMERIC, "C");
>   }

Thanks!  I prefer your suggestion :-)


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to