Date: Wed, 2 Oct 2019 16:08:01 +0000 (UTC) From: Alexander Kabaev <kan@FreeBSD.org> 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 Message-ID: <201910021608.x92G81d0044053@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910021608.x92G81d0044053>