summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2020-07-30 17:11:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2020-07-30 17:11:11 +0000
commit8eb0e7b1b3093fd1161c9bf0ed24b637af9af066 (patch)
treec9e6045e4b7ec6343c25ca3b74f8812d350ea2b5
parent356fb952210b10d685f075d0d00e86c6a313e9b8 (diff)
Improved handling of an unescaped '/' in a bracket expression.
-rw-r--r--usr.bin/awk/lex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/awk/lex.c b/usr.bin/awk/lex.c
index d33c4459437..02df0824cd5 100644
--- a/usr.bin/awk/lex.c
+++ b/usr.bin/awk/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.23 2020/07/13 14:03:52 millert Exp $ */
+/* $OpenBSD: lex.c,v 1.24 2020/07/30 17:11:10 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -551,7 +551,9 @@ int regexpr(void)
*/
if (!do_posix) {
if (c == '[') {
- if (openclass == 0 || peek() == ':') {
+ int nextc = peek();
+ if (openclass == 0 || nextc == ':' ||
+ nextc == '.' || nextc == '=') {
if (++openclass == 1)
cstart = bp;
}