• Anthony Ramine's avatar
    wildmatch: properly fold case everywhere · b79c0c37
    Anthony Ramine authored
    Case folding is not done correctly when matching against the [:upper:]
    character class and uppercased character ranges (e.g. A-Z).
    Specifically, an uppercase letter fails to match against any of them
    when case folding is requested because plain characters in the pattern
    and the whole string are preemptively lowercased to handle the base case
    That optimization is kept and ISLOWER() is used in the [:upper:] case
    when case folding is requested, while matching against a character range
    is retried with toupper() if the character was lowercase, as the bounds
    of the range itself cannot be modified (in a case-insensitive context,
    [A-_] is not equivalent to [a-_]).
    Signed-off-by: default avatarAnthony Ramine <[email protected]>
    Reviewed-by: Duy Nguyen's avatarDuy Nguyen <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
wildmatch.c 7.83 KB