bug-bash
[Top][All Lists]
Advanced

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

Re: ctype.h functions on bytes 0x80..0xFF


From: Chet Ramey
Subject: Re: ctype.h functions on bytes 0x80..0xFF
Date: Mon, 29 May 2023 14:20:45 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 5/27/23 11:57 PM, Grisha Levit wrote:
The below seems like a cheap fix for UTF-8 locales. Since Bash falls
back to using the single-byte glob matching functions when presented
with invalid multibyte strings, this patch makes the glob code avoid
calling the ctype functions or strcoll when handling individual bytes
0x7F (in a UTF-8 locale).

Thanks, the glob parts are fine.

The locale_setblanks change is for the macos issue with 0xA0 being
treated as a blank (as U+00A0).  There's no other code that changes
CSHBRK in sh_syntaxtab so I think the simplifications are OK.

The isblank change to locale_setblanks is fine, but if you want to use
locale_utf8locale in locale_setblanks, you have to change the callers to
make sure locale_utf8locale is set/reset before you try to use the new
locale's value.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]