Date: Tue, 6 Sep 2016 00:33:54 +0000 (UTC) From: "Andrey A. Chernov" <ache@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305448 - stable/11/contrib/one-true-awk Message-ID: <201609060033.u860XsnA059170@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ache Date: Tue Sep 6 00:33:54 2016 New Revision: 305448 URL: https://svnweb.freebsd.org/changeset/base/305448 Log: MFC r305365 The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The patch skips NUL as a quick fix. PR: 195792 Submitted by: kdrakehp@zoho.com Approved by: bwk@cs.princeton.edu (the author) Modified: stable/11/contrib/one-true-awk/b.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/one-true-awk/b.c ============================================================================== --- stable/11/contrib/one-true-awk/b.c Tue Sep 6 00:32:33 2016 (r305447) +++ stable/11/contrib/one-true-awk/b.c Tue Sep 6 00:33:54 2016 (r305448) @@ -841,7 +841,7 @@ int relex(void) /* lexical analyzer for if (cc->cc_name != NULL && prestr[1 + cc->cc_namelen] == ':' && prestr[2 + cc->cc_namelen] == ']') { prestr += cc->cc_namelen + 3; - for (i = 0; i < NCHARS; i++) { + for (i = 1; i < NCHARS; i++) { if (!adjbuf((char **) &buf, &bufsz, bp-buf+1, 100, (char **) &bp, "relex2")) FATAL("out of space for reg expr %.10s...", lastre); if (cc->cc_func(i)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609060033.u860XsnA059170>