GNU bug report logs - #20974
Weird newline matching behaviour in --null-data mode

Previous Next

Package: grep;

Reported by: Balazs Kezes <rlblaster <at> gmail.com>

Date: Fri, 3 Jul 2015 17:00:07 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


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

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: Balazs Kezes <rlblaster <at> gmail.com>
Cc: 20974 <at> debbugs.gnu.org
Subject: Re: bug#20974: Weird newline matching behaviour in --null-data mode
Date: Sat, 04 Jul 2015 09:36:32 +0900
On Fri, 3 Jul 2015 17:59:19 +0100
Balazs Kezes <rlblaster <at> gmail.com> wrote:

> I'm running into issues with grep in -z mode. I've managed to minimize
> it into this:
> 
> 	$ seq 2 | grep --null-data --quiet '[12].2' ; echo $?
> 	0
> 	$ seq 2 | grep --null-data --quiet '[1-2].2' ; echo $?
> 	1
> 
> I'd expect the two expressions to mean the same. I've tried this with
> the latest version built from the official sources, 2.21. I've also
> found [1] which might be related but it wasn't updated for almost 2
> years. Or is this expected?

$ seq 2 | env LC_ALL=C grep --null-data --quiet '[12].2' ; echo $?
0
$ seq 2 | env LC_ALL=C grep --null-data --quiet '[1-2].2' ; echo $?
0
$ seq 2 | env LC_ALL=en_US.iso88591 grep --null-data --quiet '[12].2' ; echo $?
0
$ seq 2 | env LC_ALL=en_US.iso88591 grep --null-data --quiet '[1-2].2' ; echo $?
1

grep depends on regex for only last case to support collating element,
but regex is not support to substitute NUL for LF as newline character
with --null-data.





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

Previous Next


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