GNU bug report logs - #20957
2.21 bug in handling at least one -P regular expression

Previous Next

Package: grep;

Reported by: vampyrebat <at> gmail.com

Date: Thu, 2 Jul 2015 07:56:02 UTC

Severity: normal

Found in version 2.21

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20957 in the body.
You can then email your comments to 20957 AT debbugs.gnu.org in the normal way.

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#20957; Package grep. (Thu, 02 Jul 2015 07:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to vampyrebat <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Thu, 02 Jul 2015 07:56:03 GMT) Full text and rfc822 format available.

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

From: vampyrebat <at> gmail.com
To: bug-grep <at> gnu.org
Subject: 2.21 bug in handling at least one -P regular expression
Date: Thu, 02 Jul 2015 02:55:28 -0500
grep 2.21 incorrectly handles a -P regular expression that 2.20 handled correctly.  Thanks for looking into this.

$ cat file
Here's a line.

This line has one blank line above it.


This line has two blank lines above it.



This line has three blank lines above it.




This line has four blank lines above it.

$ grep-2.20/src/grep -Pzo '(?<=\n\n\n).*' file
This line has two blank lines above it.
This line has three blank lines above it.
This line has four blank lines above it.
$ grep-2.21/src/grep -Pzo '(?<=\n\n\n).*' file
This line has two blank lines above it.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Fri, 03 Jul 2015 15:24:02 GMT) Full text and rfc822 format available.

Notification sent to vampyrebat <at> gmail.com:
bug acknowledged by developer. (Fri, 03 Jul 2015 15:24:02 GMT) Full text and rfc822 format available.

Message #10 received at 20957-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: vampyrebat <at> gmail.com, 20957-done <at> debbugs.gnu.org
Subject: Re: bug#20957: 2.21 bug in handling at least one -P regular expression
Date: Fri, 03 Jul 2015 08:23:43 -0700
[Message part 1 (text/plain, inline)]
vampyrebat <at> gmail.com wrote:
> grep 2.21 incorrectly handles a -P regular expression that 2.20 handled correctly.

Thanks for reporting that.  I installed the attached patches.  The first fixes 
the bug; the second is a minor cleanup.

[0001-grep-don-t-mishandle-left-context-in-P.patch (text/x-diff, attachment)]
[0002-grep-simplify-print_line_middle-slightly.patch (text/x-diff, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 01 Aug 2015 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 329 days ago.

Previous Next


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