diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | re.c | 4 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 7 | ||||
-rw-r--r-- | test/Makefile.in | 12 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/escapebrace.awk | 2 | ||||
-rw-r--r-- | test/escapebrace.in | 1 | ||||
-rw-r--r-- | test/escapebrace.ok | 1 |
9 files changed, 37 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2019-06-19 Arnold D. Robbins <arnold@skeeve.com> + + * re.c (make_regexp): If do_posix, have {} in ok_to_escape. + Thanks to Ed Morton <mortoneccc@comcast.net> for the report. + 2019-06-18 Arnold D. Robbins <arnold@skeeve.com> * 5.0.1: Release tar ball made. @@ -107,7 +107,9 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) } const char *ok_to_escape; - if (do_traditional) + if (do_posix) + ok_to_escape = "{}()|*+?.^$\\[]/-"; + else if (do_traditional) ok_to_escape = "()|*+?.^$\\[]/-"; else ok_to_escape = "<>`'BywWsS{}()|*+?.^$\\[]/-"; diff --git a/test/ChangeLog b/test/ChangeLog index 9d8f0d03..a53c2d13 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2019-06-19 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (EXTRA_DIST): New test: escapebrace. + * escapebrace.awk, escapebrace.in, escapebrace.ok: New files. + 2019-06-18 Arnold D. Robbins <arnold@skeeve.com> * 5.0.1: Release tar ball made. diff --git a/test/Makefile.am b/test/Makefile.am index 3db7c04d..58ee1304 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -266,6 +266,9 @@ EXTRA_DIST = \ dumpvars.ok \ dynlj.awk \ dynlj.ok \ + escapebrace.awk \ + scapebrace.in \ + scapebrace.ok \ eofsplit.awk \ eofsplit.ok \ eofsrc1a.awk \ @@ -1295,7 +1298,7 @@ BASIC_TESTS = \ callparam childin clobber closebad clsflnam compare compare2 \ concat1 concat2 concat3 concat4 concat5 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ - eofsplit eofsrc1 exit2 exitval1 exitval2 exitval3 \ + escapebrace eofsplit eofsrc1 exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fldterm fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fscaret fsnul1 \ fsrs fsspcoln fstabplus funsemnl funsmnam funstack \ @@ -1408,7 +1411,7 @@ NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \ NEED_NONDEC = mpfrbigint2 nondec2 intarray forcenum # List of tests that need --posix -NEED_POSIX = printf0 posix2008sub paramasfunc1 paramasfunc2 muldimposix +NEED_POSIX = escapebrace printf0 posix2008sub paramasfunc1 paramasfunc2 muldimposix # List of tests that need --pretty-print NEED_PRETTY = nsprof1 nsprof2 \ diff --git a/test/Makefile.in b/test/Makefile.in index 5496d3cf..ce5b2e26 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -525,6 +525,9 @@ EXTRA_DIST = \ dumpvars.ok \ dynlj.awk \ dynlj.ok \ + escapebrace.awk \ + scapebrace.in \ + scapebrace.ok \ eofsplit.awk \ eofsplit.ok \ eofsrc1a.awk \ @@ -1554,7 +1557,7 @@ BASIC_TESTS = \ callparam childin clobber closebad clsflnam compare compare2 \ concat1 concat2 concat3 concat4 concat5 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ - eofsplit eofsrc1 exit2 exitval1 exitval2 exitval3 \ + escapebrace eofsplit eofsrc1 exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fldterm fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fscaret fsnul1 \ fsrs fsspcoln fstabplus funsemnl funsmnam funstack \ @@ -1666,7 +1669,7 @@ NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \ NEED_NONDEC = mpfrbigint2 nondec2 intarray forcenum # List of tests that need --posix -NEED_POSIX = printf0 posix2008sub paramasfunc1 paramasfunc2 muldimposix +NEED_POSIX = escapebrace printf0 posix2008sub paramasfunc1 paramasfunc2 muldimposix # List of tests that need --pretty-print NEED_PRETTY = nsprof1 nsprof2 \ @@ -3023,6 +3026,11 @@ dynlj: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +escapebrace: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + eofsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index cf85ef8d..a17bf90e 100644 --- a/test/Maketests +++ b/test/Maketests @@ -272,6 +272,11 @@ dynlj: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +escapebrace: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + eofsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/escapebrace.awk b/test/escapebrace.awk new file mode 100644 index 00000000..bda73431 --- /dev/null +++ b/test/escapebrace.awk @@ -0,0 +1,2 @@ +/\{/ +# should be no warning diff --git a/test/escapebrace.in b/test/escapebrace.in new file mode 100644 index 00000000..b1d2cc0f --- /dev/null +++ b/test/escapebrace.in @@ -0,0 +1 @@ +foo{bar diff --git a/test/escapebrace.ok b/test/escapebrace.ok new file mode 100644 index 00000000..b1d2cc0f --- /dev/null +++ b/test/escapebrace.ok @@ -0,0 +1 @@ +foo{bar |