GNU bug report logs - #51256
grep --ignore-case --color does not always color the matches

Previous Next

Package: grep;

Reported by: Tomasz Dziendzielski <tomasz.dziendzielski <at> gmail.com>

Date: Mon, 18 Oct 2021 04:00:03 UTC

Severity: normal

Merged with 39678, 51255, 51257

To reply to this bug, email your comments to 51256 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#51256; Package grep. (Mon, 18 Oct 2021 04:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomasz Dziendzielski <tomasz.dziendzielski <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Mon, 18 Oct 2021 04:00:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomasz Dziendzielski <tomasz.dziendzielski <at> gmail.com>
To: bug-grep <at> gnu.org
Cc: 39678 <at> debbugs.gnu.org
Subject: grep --ignore-case --color does not always color the matches
Date: Mon, 18 Oct 2021 00:02:36 +0200
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]
[0001-grep-Don-t-print-line-if-matcher-returned-nothing.patch (application/octet-stream, attachment)]

Merged 51255 51256 51257. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Wed, 24 Nov 2021 02:50:02 GMT) Full text and rfc822 format available.

Merged 39678 51255 51256 51257. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Wed, 24 Nov 2021 02:52:01 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 203 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.