[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17056: dfa.c patch for systems with no locale support
From: |
Eric Blake |
Subject: |
bug#17056: dfa.c patch for systems with no locale support |
Date: |
Thu, 27 Mar 2014 13:04:32 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 03/27/2014 12:57 PM, Paul Eggert wrote:
> On 03/27/2014 11:48 AM, Aharon Robbins wrote:
>> What if
>> the system's setlocale() actually returns NULL?
> Then we don't know what the locale is. Perhaps setlocale ran out of
> memory and so returned NULL. If so, subsequent calls might use some
> weird Turkish locale with multibyte characters. So it sounds safer to
> assume the worst in that case.
This is in main(). POSIX guarantees that until setlocale() is called
for the first time, we are in the C locale. If you were in a library, I
could buy the argument of setlocale() returning NULL as indicative of
some rare error. But in main(), where you are the first call, the only
thing that a NULL return implies is that your attempt to change the
locale had no effect, so it remains at the locale it was before, which
is the C locale since all programs start in the C locale.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/21
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/21
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/23
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/23
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/26
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/27
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/27
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/27
- bug#17056: dfa.c patch for systems with no locale support,
Eric Blake <=
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/28
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/28