Re: [PATCH] Enhance virBuffer code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Richard W.M. Jones" <rjones@xxxxxxxxxx> wrote:
> Jim Meyering wrote:
>> What do you think of using this?
>>
>>   isascii (*p) && isalnum (*p)
>
> I'm not sure I'm qualified to say what this does on EBCDIC, but quite
> likely lots of other code breaks there too anyway.  This is nicely
> self-documenting anyway.

As Daniel suggested, isalnum is locale-sensitive.
If there's a locale with an alphabetic byte that is outside
the logical a-zA-Z range, yet still within 0..127, then the above
expression will give a false-positive for that byte.

I've been inclined to stop worrying about EBCDIC for years, but a quick
search on the web finds that people are still stuck using it, and do
report bugs in ASCII-assuming code.

This is why autoconf goes to the trouble of doing this:
  tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
not this:
  tr a-z A-Z
to convert to upper case.

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]