Re: cygwin results [was: [platform-testers] new snapshot available: core
From:
Assaf Gordon
Subject:
Re: cygwin results [was: [platform-testers] new snapshot available: coreutils-8.22.151-37b36]
Date:
Tue, 15 Jul 2014 12:33:19 -0400
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
Hello Eric, PƔdraig,
On 07/15/2014 12:33 AM, Eric Blake wrote:
Here's some real errors:
<...>
Ouch. isdigit() is fairly safe (because POSIX limits it to returning
true for exactly 10 bytes that can't become negative when promoted to
int), but isblank((int)char) is an absolute bug - there are locales
where isblank(255) != isblank((int)(char)255), because char is signed
and the value promotes to -1 which is indistinguishable from EOF. Are
you sure this code shouldn't be using gnulib's c_isdgit and c_isblank
instead? And if you DO want locale comparisons, then use isblank
(to_uchar (**endptr)).
Attached is a patch to replace isdigit/isblank with c_isdigit/c_isblank in
numfmt.
Since numfmt currently does not handle multibyte characters, it is simpler (and
quicker for this release) to force the C locale calls, as you suggested.
I hope in the future to add true multibyte support.
Regards,
-gordon