X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:date:message-id:subject:from:to
	:content-type; q=dns; s=default; b=SZ/it7B3KP7gIEVdGwLY2VT4Ka1gv
	7JibeAdUL7h+i7Xx/T8L1lhLw2vWHTyFnubhMzMot/rI+iuBeog8YIUFrL/HPwEG
	2aC4MFe1IH4mxLdzA7N7JxMKi1sWmdc/998oCODVdzSmaPNDYYukj1JrctU/uEk4
	1gKX/F1y2olyDQ=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:date:message-id:subject:from:to
	:content-type; s=default; bh=EEBkRH/j/TA3jOXsLtFq4e49uHM=; b=jp8
	SXbSSbLGmPzzb+Av5VBbcFRfr3hU5DbsJdmXHpVbIng3YGEysAFPyqXVOkkx7Qzf
	j+y6qXTxntSu3jlgU9nmHwYPmPUfOZ5dimGm38ayiXNDpSqWkdN5uJMRTxdCKLv5
	u5aSolM54tzvEiKudMCl12VQgm7iqmqOT0EMjz+8=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-ig0-f173.google.com
MIME-Version: 1.0
X-Received: by 10.107.160.196 with SMTP id j187mr13886219ioe.80.1437096558392; Thu, 16 Jul 2015 18:29:18 -0700 (PDT)
Date: Thu, 16 Jul 2015 20:29:18 -0500
Message-ID: <CAAXzdLWo4nvaJBMOBYsOYeCdrgw_O=8CM_H_kwfxnU=AqnuOjA@mail.gmail.com>
Subject: --line-regexp option with null data
From: Steven Penny <svnpenn@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes

Consider this command:

    printf 'alpha\nbravo\ncharlie\n' | grep --line-regexp --quiet bravo

grep sees 3 lines separated by newline, and matches the bravo line. Now consider
this command:

    printf 'alpha\0bravo\0charlie\0' | grep --line-regexp --quiet bravo

My thinking tells me that because I have not used `--null-data`, grep should see
1 or even 0 lines separated by newline, and fail to match a `bravo` followed by
newline. However it does not, it succeeds just like the first command, why is
this?

Note I also tried this on Debian with Grep 2.2 and it works as expected.

http://stackoverflow.com/q/31467045

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

