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

From: Tomasz Dziendzielski <[email-masked]>
Date: Mon, 18 Oct 2021 15:39:03 +0200

Additional note, according to POSIX regex standard:
"An ordinary character is a BRE that matches itself: any character in the
supported character set, except for the BRE special characters listed in
BRE Special Characters.
The interpretation of an ordinary character preceded by an unescaped
<backslash> ( '\\' ) is undefined, except for: [...]"
which means that escaping ordinary characters (like \a) has undefined
behaviour, thus I think it should not be matched.
So having EGexecute match 'a' to '\a' is incorrect, and instead we should
remove the matching and make sure it's not printed. That would make my
patch correct.

Reference:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_03

Looking forward to feedback.

Best regards,
Tomasz Dziendzielski

pon., 18 paź 2021 o 07:10 Tomasz Dziendzielski <
[email-masked]> napisał(a):

> Also, even if we assume it should return a match (which I think it
> shouldn't), then there's a second bug in print_line_middle, because why
> would it print anything if there was no match?
>
> Best regards,
> Tomasz Dziendzielski
>