summaryrefslogtreecommitdiff
path: root/contrib/one-true-awk
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2016-09-03 23:04:56 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2016-09-03 23:04:56 +0000
commitcd3912b6be0c28ff45f3d8853d69abf3e08e7d18 (patch)
treeab8458c6f3529b2c9e9f3adc6e3e63ce91f454f1 /contrib/one-true-awk
parentd96700a6da2afa88607fbd7405ade439424d10d9 (diff)
downloadsrc-test-cd3912b6be0c28ff45f3d8853d69abf3e08e7d18.tar.gz
src-test-cd3912b6be0c28ff45f3d8853d69abf3e08e7d18.zip
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) MFC after: 3 days
Notes
Notes: svn path=/head/; revision=305365
Diffstat (limited to 'contrib/one-true-awk')
-rw-r--r--contrib/one-true-awk/b.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/one-true-awk/b.c b/contrib/one-true-awk/b.c
index 01b91f3f67b6f..96ecdd23af5f9 100644
--- a/contrib/one-true-awk/b.c
+++ b/contrib/one-true-awk/b.c
@@ -841,7 +841,7 @@ int relex(void) /* lexical analyzer for reparse */
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)) {