[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sleep with LANG="address@hidden"
From: |
Jim Meyering |
Subject: |
Re: sleep with LANG="address@hidden" |
Date: |
Sat, 29 Nov 2003 12:59:06 +0100 |
Paul Eggert <address@hidden> wrote:
> Jim Meyering <address@hidden> 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 :-)