[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#39678: grep --ignore-case --color does not always color the matches
From: |
Tomasz Dziendzielski |
Subject: |
bug#39678: grep --ignore-case --color does not always color the matches |
Date: |
Mon, 18 Oct 2021 00:26:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 |
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 you 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
0001-grep-Don-t-print-line-if-matcher-returned-nothing.patch
Description: Text Data