GNU bug report logs - #25655
grep-2.28 is broken with multiple -e patterns

Previous Next

Package: grep;

Reported by: Lars Wendler <polynomial-c <at> gentoo.org>

Date: Wed, 8 Feb 2017 19:53:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#25655: closed (grep-2.28 is broken with multiple -e patterns)
Date: Wed, 08 Feb 2017 21:05:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 8 Feb 2017 13:04:25 -0800
with message-id <c660717f-22f2-5011-54c7-83342db7dcee <at> cs.ucla.edu>
and subject line Re: bug#25655: grep-2.28 is broken with multiple -e patterns
has caused the debbugs.gnu.org bug report #25655,
regarding grep-2.28 is broken with multiple -e patterns
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
25655: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25655
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Lars Wendler <polynomial-c <at> gentoo.org>
To: bug-grep <at> gnu.org
Cc: base-system <at> gentoo.org
Subject: grep-2.28 is broken with multiple -e patterns
Date: Wed, 8 Feb 2017 20:49:35 +0100
[Message part 3 (text/plain, inline)]
Hi,

we got a bug report a Gentoo [1] that grep-2.28 is broken when
searching for multiple patterns with -e:

grep-2.27:

  % echo ".tar" | grep -e "\.tar"; echo $?           
  .tar
  0

  % echo ".tar" | grep -e "\.tar" -e "\.tbz"; echo $?
  .tar
  0


grep-2.28:

   % echo ".tar" | grep -e "\.tar"; echo $?           
   .tar
   0

   % echo ".tar" | grep -e "\.tar" -e "\.tbz"; echo $?
   1


But this seems to be not the only issue:


echo "atbz" | grep -e "\.tar" -e ".tbz"

is matching "atbz"

echo ".tbz" | grep -e "\.tar" -e ".tbz"

matches ".tbz"

but

echo ".tar" | grep -e "\.tar" -e "tar"

only matches "ta".


We've identified commit 290ca116c9172d97b2b026951fac722d3bd3ced9 as the
one that introduced this regression

Kind regards
Lars

[1] https://bugs.gentoo.org/608644

-- 
Lars Wendler
Gentoo package maintainer
GPG: 21CC CF02 4586 0A07 ED93  9F68 498F E765 960E 9B39

Attention! New gpg key! See
https://www.gentoofan.org/blog/index.php?/archives/9-New-gpg-keys.html
[Message part 4 (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Lars Wendler <polynomial-c <at> gentoo.org>, 25655-done <at> debbugs.gnu.org
Cc: base-system <at> gentoo.org
Subject: Re: bug#25655: grep-2.28 is broken with multiple -e patterns
Date: Wed, 8 Feb 2017 13:04:25 -0800
[Message part 6 (text/plain, inline)]
Thanks for reporting that. It's a reasonably serious bug. I installed 
the attached patch to fix it.
[0001-grep-do-not-mishandle-.-in-multiple-patterns.patch (application/x-patch, attachment)]

This bug report was last modified 8 years and 109 days ago.

Previous Next


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