summaryrefslogtreecommitdiff
path: root/usr.bin/awk/awk.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2020-06-13 01:19:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2020-06-13 01:19:56 +0000
commit317faf26d7c732fe1661e940b697b94c509d22f8 (patch)
treea386c9a69366eaaf4e4385e97497da7d3b0a2978 /usr.bin/awk/awk.h
parent8224e8d9b044b699034e06344410040ca86417eb (diff)
POSIX doesn't permit an unescaped '/' in an extended regular expression.
Unlike upstream awk, ours has historically allowed unescaped '/' inside a bracket expression for compatibility with other awk implementations but the check was too simple-minded. This improves the matching to allow things like /[]/]/, /[^]// and '/[abc[:digit:]/@#]/' To enable strict POSIX compliance, set POSIXLY_CORRECT.
Diffstat (limited to 'usr.bin/awk/awk.h')
-rw-r--r--usr.bin/awk/awk.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/awk/awk.h b/usr.bin/awk/awk.h
index e55af318b9a..080bf94cc22 100644
--- a/usr.bin/awk/awk.h
+++ b/usr.bin/awk/awk.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: awk.h,v 1.23 2020/06/10 21:06:09 millert Exp $ */
+/* $OpenBSD: awk.h,v 1.24 2020/06/13 01:19:55 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -62,6 +62,7 @@ extern enum compile_states {
} compile_time;
extern bool safe; /* false => unsafe, true => safe */
+extern bool do_posix; /* true if POSIXLY_CORRECT set */
#define RECSIZE (8 * 1024) /* sets limit on records, fields, etc., etc. */
extern int recsize; /* size of current record, orig RECSIZE */