From nobody Wed Nov 10 06:46:44 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5CF51184F2D9; Wed, 10 Nov 2021 06:46:44 +0000 (UTC) (envelope-from git@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 4HpwPJ27Vpz4kh6; Wed, 10 Nov 2021 06:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 29A4013FBA; Wed, 10 Nov 2021 06:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AA6kic5012263; Wed, 10 Nov 2021 06:46:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA6kikD012262; Wed, 10 Nov 2021 06:46:44 GMT (envelope-from git) Date: Wed, 10 Nov 2021 06:46:44 GMT Message-Id: <202111100646.1AA6kikD012262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4c14980baab5 - main - grep: fix/remove references to -P List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c14980baab5aa678fa8a1ca046892cf30e92d71 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4c14980baab5aa678fa8a1ca046892cf30e92d71 commit 4c14980baab5aa678fa8a1ca046892cf30e92d71 Author: Kyle Evans AuthorDate: 2021-11-10 06:42:42 +0000 Commit: Kyle Evans CommitDate: 2021-11-10 06:42:42 +0000 grep: fix/remove references to -P -P in gnugrepland means PCRE, which we do not support. We may eventually support it if onigmo ends up getting imported as a more performant regex implementation, and we can re-add it properly in these places (and more) when that time comes. The optstr change is a functional nop; the case was not explicitly handled, thus ending in usage() anyways. Reported by: Vladimir Misev (via twitter) --- usr.bin/grep/grep.1 | 4 ++-- usr.bin/grep/grep.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/grep/grep.1 b/usr.bin/grep/grep.1 index 5f314d0dff7c..3312f2510d30 100644 --- a/usr.bin/grep/grep.1 +++ b/usr.bin/grep/grep.1 @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd April 17, 2021 +.Dd November 10, 2021 .Dt GREP 1 .Os .Sh NAME @@ -558,7 +558,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl AaBbCDdGHhILmoPRSUVw +.Op Fl AaBbCDdGHhILmopRSUVw are extensions to that specification, and the behaviour of the .Fl f flag when used with an empty pattern file is left undefined. diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 6fbd6bee8ace..6306cbff5932 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -57,7 +57,7 @@ const char *errstr[] = { "", /* 1*/ "(standard input)", /* 2*/ "unknown %s option", -/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C num]\n", +/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOopqRSsUVvwxz] [-A num] [-B num] [-C num]\n", /* 4*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n", /* 5*/ "\t[--context=num] [--directories=action] [--label] [--line-buffered]\n", /* 6*/ "\t[--null] [pattern] [file ...]\n", @@ -110,7 +110,7 @@ bool lbflag; /* --line-buffered */ bool nullflag; /* --null */ char *label; /* --label */ const char *color; /* --color */ -int grepbehave = GREP_BASIC; /* -EFGP: type of the regex */ +int grepbehave = GREP_BASIC; /* -EFG: type of the regex */ int binbehave = BINFILE_BIN; /* -aIU: handling of binary files */ int filebehave = FILE_STDIO; int devbehave = DEV_READ; /* -D: handling of devices */ @@ -152,7 +152,7 @@ usage(void) exit(2); } -static const char *optstr = "0123456789A:B:C:D:EFGHILOPSRUVabcd:e:f:hilm:nopqrsuvwxyz"; +static const char *optstr = "0123456789A:B:C:D:EFGHILOSRUVabcd:e:f:hilm:nopqrsuvwxyz"; static const struct option long_options[] = {