diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2020-10-11 16:39:24 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2020-10-11 16:39:24 +0300 |
commit | a3e187cbb5c9ef951152f18fee1d36c93e4abbe5 (patch) | |
tree | 9f351195b64fbaa4a856b18510007a6eaa897c16 | |
parent | dd9b0921ee9a6918279b3245d4373fdd1180ee13 (diff) | |
download | egawk-a3e187cbb5c9ef951152f18fee1d36c93e4abbe5.tar.gz egawk-a3e187cbb5c9ef951152f18fee1d36c93e4abbe5.tar.bz2 egawk-a3e187cbb5c9ef951152f18fee1d36c93e4abbe5.zip |
Small improvement for regexp maybe_long criteria.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | re.c | 2 |
3 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2020-10-11 Arnold D. Robbins <arnold@skeeve.com> + + * re.c (make_regexp): Add {} to characters that cause rp->maybe_long + to be true. + * io.c (rsrescan): Update comment for step 4. + 2020-09-21 Arnold D. Robbins <arnold@skeeve.com> * awk.h (enum redirect_flags): Add RED_NONE. @@ -3753,7 +3753,7 @@ again: * "abc" into the front of the next record. Ooops. * * The re->maybe_long member is true if the - * regex contains one of: + * ? |. This is a very + * regex contains one of: + * ? | { }. This is a very * simple heuristic, but in combination with the * "end of match within a few bytes of end of buffer" * check, should keep things reasonable. @@ -282,7 +282,7 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) } for (i = len - 1; i >= 0; i--) { - if (strchr("*+|?", buf[i]) != NULL) { + if (strchr("*+|?{}", buf[i]) != NULL) { rp->maybe_long = true; break; } |