Subject: Re: bug#39678: 'grep --ignore-case --color' does not always color the matches

From: Tomasz Dziendzielski <[email-masked]>
Date: Wed, 20 Oct 2021 03:10:25 +0200

>> I found that for optimization purposes common cases in
re_string_peek_byte
>> are missed if pstr->mbs_allocated is true, thus skipping them also for
case
>> insensitive.

>Unfortunately I've lost context here. Is this patch being proposed to
>improve performance, or to fix a bug?

>I don't see how the patch preserves correctness: if pstr->icase is true,
>surely in general we need to look at the translated string, not the
>original.

It's to fix the bug. Without the patch if we use icase this
re_string_peek_byte was not executed and as a consequence match is not
found.
If we apply the patch grep is able to match the '\a' correctly. The patch
has nothing to do with improving performance, if was just an additional
comment from my side that the fix should not affect the performance (in my
opinion). Sorry for confusion.

Best regards,
Tomasz Dziendzielski