bug-bash
[Top][All Lists]
Advanced

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

Re: A question about bash change for efficiency speedups in multibyte lo


From: Chet Ramey
Subject: Re: A question about bash change for efficiency speedups in multibyte locales
Date: Mon, 9 Apr 2018 18:04:18 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 4/3/18 9:23 PM, yangyajing wrote:
> I don't think it should check for '[:',  but it should check if the
> pattern is defined in the charclass even if the pattern does not have a
> multibyte character.

I'll add something so that the code only falls back to the single-byte
matcher if there is a potentially (since these things can always be fooled)
unrecognized character class. The single-byte code only handles a small
set of character class names, and you can check for those quickly. Much
faster than calling wctype for everything -- just assume that anything
that doesn't have one of the single-byte char class names is a locale-
specific character class.

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]