diff --git a/doc/html/pcre2_set_heap_limit.html b/doc/html/pcre2_set_heap_limit.html new file mode 100644 index 0000000..3631ef6 --- /dev/null +++ b/doc/html/pcre2_set_heap_limit.html @@ -0,0 +1,40 @@ + + +pcre2_set_heap_limit specification + + +

pcre2_set_heap_limit man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_heap_limit(pcre2_match_context *mcontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This function sets the backtracking heap limit field in a match context. The +result is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/src/pcre2_match.c b/src/pcre2_match.c index ed6d604..60d792d 100644 --- a/src/pcre2_match.c +++ b/src/pcre2_match.c @@ -802,11 +802,15 @@ fprintf(stderr, "++ op=%d\n", *Fecode); RRETURN(MATCH_NOMATCH); /* Also fail if PCRE2_ENDANCHORED is set and the end of the match is not - the end of the subject. */ + the end of the subject. After (*ACCEPT) we fail the entire match (at this + position) but backtrack on reaching the end of the pattern. */ if (Feptr < mb->end_subject && ((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0) - RRETURN(MATCH_NOMATCH); + { + if (Fop == OP_END) RRETURN(MATCH_NOMATCH); + return MATCH_NOMATCH; + } /* We have a successful match of the whole pattern. Record the result and then do a direct return from the function. If there is space in the offset diff --git a/testdata/testinput2 b/testdata/testinput2 index c49c26b..f1a84b6 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -5038,6 +5038,9 @@ a)"xI \= Expect no match xyzabcdef +/a(*ACCEPT)x|aa/endanchored + aaa + #subject -no_jit # Check auto-anchoring when there is a group that is never obeyed at diff --git a/testdata/testoutput2 b/testdata/testoutput2 index 67dfc1a..f820c3b 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -15574,6 +15574,10 @@ No match xyzabcdef No match +/a(*ACCEPT)x|aa/endanchored + aaa + 0: a + #subject -no_jit # Check auto-anchoring when there is a group that is never obeyed at