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

Previous Next

Package: grep;

Reported by: Benno Schulenberg <bensberg <at> telfort.nl>

Date: Wed, 19 Feb 2020 15:28:01 UTC

Severity: normal

Merged with 51255, 51256, 51257

Full log


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

From: Tomasz Dziendzielski <tomasz.dziendzielski <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 39678 <at> debbugs.gnu.org
Subject: Re: bug#39678: 'grep --ignore-case --color' does not always color the
 matches
Date: Tue, 19 Oct 2021 20:36:43 +0200
[Message part 1 (text/plain, inline)]
I found that for optimization purposes common cases in re_string_peek_byte
are missed if pstr->mbs_allocated is true, thus skipping them also for case
insensitive.

My solution would be to return re_string_peek_byte also if pstr->icase is
true. mbs_allocated is changed also depending on icase but I don't think we
want to change it globally, so I think my patch should be fine and not
affect optimization.

Please check the attachment. If the patch is fine should I also send this
to gnulib mailing list to have it submitted or is this one enough?

Best regards,
Tomasz Dziendzielski
[Message part 2 (text/html, inline)]
[0001-regex-Handle-common-easiest-cases-if-case-insensitiv.patch (text/x-patch, attachment)]

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

Previous Next


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