From owner-freebsd-bugs@freebsd.org Fri Feb 5 03:00:50 2021 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6679D53AA90 for ; Fri, 5 Feb 2021 03:00:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DX0Xy2FFDz3tVk for ; Fri, 5 Feb 2021 03:00:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 4B2CB53A99A; Fri, 5 Feb 2021 03:00:50 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AF2453AA21 for ; Fri, 5 Feb 2021 03:00:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DX0Xy1Znkz3tPw for ; Fri, 5 Feb 2021 03:00:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27E10171E8 for ; Fri, 5 Feb 2021 03:00:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 11530obN092975 for ; Fri, 5 Feb 2021 03:00:50 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 11530o41092974 for bugs@FreeBSD.org; Fri, 5 Feb 2021 03:00:50 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 253209] grep -v -f some-empty-file -- does the wrong thing Date: Fri, 05 Feb 2021 03:00:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: kevans@freebsd.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 03:00:50 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253209 --- Comment #2 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Df823c6dc730b0dd08b54a53be1d8fd587= eee7021 commit f823c6dc730b0dd08b54a53be1d8fd587eee7021 Author: Kyle Evans AuthorDate: 2021-02-04 21:26:45 +0000 Commit: Kyle Evans CommitDate: 2021-02-05 02:59:42 +0000 grep: fix null pattern and empty pattern file behavior The null pattern semantics were terrible because I tried to match gnugr= ep, but I got it wrong. Let's unwind that: - The null pattern should match every line if neither -w nor -x. - The null pattern should match empty lines if -x. - The null pattern should not match any lines if -w. The first two will stop processing (shortcut) even if additional patter= ns are specified. In any other case, we will continue processing other patterns. If no other patterns are specified beside a null pattern, th= en we match if neither -w nor -x or set and do not match if either of those are specified. The justification for -w is that it should match on a whole word, but t= he null pattern deos not have a whole word to match on. Empty pattern files should never match anything, and more importantly, = -v should cause everything to be written. PR: 253209 MFC-after: 4 days contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 22 +++++++++++++++--- usr.bin/grep/grep.c | 11 --------- usr.bin/grep/util.c | 35 +++++++++++++------------= ---- 3 files changed, 35 insertions(+), 33 deletions(-) --=20 You are receiving this mail because: You are on the CC list for the bug.=