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: Sun, 17 Oct 2021 22:38:27 +0200

Hello,
I did some investigation and it seems the problem with "\a" is not that the
output is not colored but that it's printed at all while it should not be.
It's being printed even when re_search in EGexecute doesn't return a match.
As a result the for loop in print_line_middle is not being run - this means
the "a" output that one can see is not from the matched string but from the
rest of the line. To fix this I suggest to return NULL from
print_line_middle if `b` variable equals NULL - which means the loop was
not executed.

I'm sending the patch with the fix in the attachment.

Best regards,
Tomasz Dziendzielski

Attachment: 0001-grep-Don-t-print-line-if-matcher-returned-nothing.patch
Description: Source code patch


reply via email to

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