Subject: bug#25655: closed (Re: bug#25655: grep-2.28 is broken with multiple -e patterns)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 08 Feb 2017 21:05:02 +0000

Your bug report

#25655: grep-2.28 is broken with multiple -e patterns

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
25655: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25655
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#25655: grep-2.28 is broken with multiple -e patterns
From: Paul Eggert <[email-masked]>
To: Lars Wendler <[email-masked]>, [email-masked]
Cc: [email-masked]
Date: Wed, 8 Feb 2017 13:04:25 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for reporting that. It's a reasonably serious bug. I installed 
the attached patch to fix it.

Subject: grep-2.28 is broken with multiple -e patterns
From: Lars Wendler <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Wed, 8 Feb 2017 20:49:35 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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