Author: ache
Date: Sat Sep  3 23:04:56 2016
New Revision: 305365
URL: https://svnweb.freebsd.org/changeset/base/305365

Log:
  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:   kdrak...@zoho.com
  Approved by:    b...@cs.princeton.edu (the author)
  MFC after:      3 days

Modified:
  head/contrib/one-true-awk/b.c

Modified: head/contrib/one-true-awk/b.c
==============================================================================
--- head/contrib/one-true-awk/b.c       Sat Sep  3 21:41:29 2016        
(r305364)
+++ head/contrib/one-true-awk/b.c       Sat Sep  3 23:04:56 2016        
(r305365)
@@ -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)) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to