GNU bug report logs - #51235
resolve old FIXME in PCRE implementation to allow more than 1 expression

Previous Next

Package: grep;

Reported by: Carlo Arenas <carenas <at> gmail.com>

Date: Sat, 16 Oct 2021 07:29:01 UTC

Severity: normal

Tags: moreinfo

Full log


View this message in rfc822 format

From: Carlo Arenas <carenas <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 51235 <at> debbugs.gnu.org
Subject: bug#51235: resolve old FIXME in PCRE implementation to allow more than 1 expression
Date: Sat, 16 Oct 2021 01:58:29 -0700
On Sat, Oct 16, 2021 at 12:50 AM Paul Eggert <eggert <at> cs.ucla.edu> wrote:
>
> On 10/16/21 12:00 AM, Carlo Arenas wrote:
> > With this patch, multiple expressions (from -e or -f) are now
> > acceptable with -P for easier side by side comparison with the other
> > supported engines.
>
> Surely this mishandles shell commands like this one:
>
> grep -P '[
> a]'
>
> which should be an error, but with that patch would not be an error.

of course, but ironically without the patch, the error isn't correct either:

$ grep -P '[
> a]'
grep: the -P option only supports a single pattern

I would say that for a 4 line patch with negative byte count, it is
worth the trade.
But if you feel so strongly against it, doing the one that compiles
every line independently and that will catch that problem wouldn't be
that difficult, but I would rather do it as a follow up, and is
definitely going to be bigger.

Carlo




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

Previous Next


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