From owner-svn-src-head@freebsd.org  Wed Oct  2 16:08:02 2019
Return-Path: <owner-svn-src-head@freebsd.org>
Delivered-To: svn-src-head@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 148501328EF;
 Wed,  2 Oct 2019 16:08:02 +0000 (UTC) (envelope-from kan@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)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 46k1JK6tC9z4cK2;
 Wed,  2 Oct 2019 16:08:01 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF6E02DEFC;
 Wed,  2 Oct 2019 16:08:01 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92G81ng044055;
 Wed, 2 Oct 2019 16:08:01 GMT (envelope-from kan@FreeBSD.org)
Received: (from kan@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92G81d0044053;
 Wed, 2 Oct 2019 16:08:01 GMT (envelope-from kan@FreeBSD.org)
Message-Id: <201910021608.x92G81d0044053@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org
 using -f
From: Alexander Kabaev <kan@FreeBSD.org>
Date: Wed, 2 Oct 2019 16:08:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r353011 - in head/usr.bin: killall split
X-SVN-Group: head
X-SVN-Commit-Author: kan
X-SVN-Commit-Paths: in head/usr.bin: killall split
X-SVN-Commit-Revision: 353011
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Oct 2019 16:08:02 -0000

Author: kan
Date: Wed Oct  2 16:08:01 2019
New Revision: 353011
URL: https://svnweb.freebsd.org/changeset/base/353011

Log:
  Revert r352953: Convert pnmatch to single element array in regexec calls
  
  Requested by: cem

Modified:
  head/usr.bin/killall/killall.c
  head/usr.bin/split/split.c

Modified: head/usr.bin/killall/killall.c
==============================================================================
--- head/usr.bin/killall/killall.c	Wed Oct  2 15:45:49 2019	(r353010)
+++ head/usr.bin/killall/killall.c	Wed Oct  2 16:08:01 2019	(r353011)
@@ -98,7 +98,7 @@ main(int ac, char **av)
 	struct stat	sb;
 	struct passwd	*pw;
 	regex_t		rgx;
-	regmatch_t	pmatch[1];
+	regmatch_t	pmatch;
 	int		i, j, ch;
 	char		buf[256];
 	char		first;
@@ -361,9 +361,9 @@ main(int ac, char **av)
 				}
 			}
 			if (mflag) {
-				pmatch[0].rm_so = 0;
-				pmatch[0].rm_eo = strlen(thiscmd);
-				if (regexec(&rgx, thiscmd, 0, pmatch,
+				pmatch.rm_so = 0;
+				pmatch.rm_eo = strlen(thiscmd);
+				if (regexec(&rgx, thiscmd, 0, &pmatch,
 				    REG_STARTEND) != 0)
 					matched = 0;
 				regfree(&rgx);
@@ -387,9 +387,9 @@ main(int ac, char **av)
 				}
 			}
 			if (mflag) {
-				pmatch[0].rm_so = 0;
-				pmatch[0].rm_eo = strlen(thiscmd);
-				if (regexec(&rgx, thiscmd, 0, pmatch,
+				pmatch.rm_so = 0;
+				pmatch.rm_eo = strlen(thiscmd);
+				if (regexec(&rgx, thiscmd, 0, &pmatch,
 				    REG_STARTEND) == 0)
 					matched = 1;
 				regfree(&rgx);

Modified: head/usr.bin/split/split.c
==============================================================================
--- head/usr.bin/split/split.c	Wed Oct  2 15:45:49 2019	(r353010)
+++ head/usr.bin/split/split.c	Wed Oct  2 16:08:01 2019	(r353011)
@@ -281,11 +281,11 @@ split2(void)
 
 		/* Check if we need to start a new file */
 		if (pflag) {
-			regmatch_t pmatch[1];
+			regmatch_t pmatch;
 
-			pmatch[0].rm_so = 0;
-			pmatch[0].rm_eo = len - 1;
-			if (regexec(&rgx, bfr, 0, pmatch, REG_STARTEND) == 0)
+			pmatch.rm_so = 0;
+			pmatch.rm_eo = len - 1;
+			if (regexec(&rgx, bfr, 0, &pmatch, REG_STARTEND) == 0)
 				newfile();
 		} else if (lcnt++ == numlines) {
 			newfile();