bug-grep
[Top][All Lists]
Advanced

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

bug#39678: 'grep --ignore-case --color' does not always color the matche


From: Tomasz Dziendzielski
Subject: bug#39678: 'grep --ignore-case --color' does not always color the matches
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 <
tomasz.dziendzielski@gmail.com> 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
>


reply via email to

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