[Pcre-svn] [740] code/trunk: Fix ACCEPT issue with ENDANCHOR…

Inizio della pagina
Delete this message
Autore: Subversion repository
Data:  
To: pcre-svn
Oggetto: [Pcre-svn] [740] code/trunk: Fix ACCEPT issue with ENDANCHORED.
Revision: 740
          http://www.exim.org/viewvc/pcre2?view=rev&revision=740
Author:   ph10
Date:     2017-04-11 15:53:26 +0100 (Tue, 11 Apr 2017)
Log Message:
-----------
Fix ACCEPT issue with ENDANCHORED.


Modified Paths:
--------------
    code/trunk/src/pcre2_match.c
    code/trunk/testdata/testinput2
    code/trunk/testdata/testoutput2


Added Paths:
-----------
    code/trunk/doc/html/pcre2_set_heap_limit.html


Added: code/trunk/doc/html/pcre2_set_heap_limit.html
===================================================================
--- code/trunk/doc/html/pcre2_set_heap_limit.html                            (rev 0)
+++ code/trunk/doc/html/pcre2_set_heap_limit.html    2017-04-11 14:53:26 UTC (rev 740)
@@ -0,0 +1,40 @@
+<html>
+<head>
+<title>pcre2_set_heap_limit specification</title>
+</head>
+<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
+<h1>pcre2_set_heap_limit man page</h1>
+<p>
+Return to the <a href="index.html">PCRE2 index page</a>.
+</p>
+<p>
+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.
+<br>
+<br><b>
+SYNOPSIS
+</b><br>
+<P>
+<b>#include &#60;pcre2.h&#62;</b>
+</P>
+<P>
+<b>int pcre2_set_heap_limit(pcre2_match_context *<i>mcontext</i>,</b>
+<b>  uint32_t <i>value</i>);</b>
+</P>
+<br><b>
+DESCRIPTION
+</b><br>
+<P>
+This function sets the backtracking heap limit field in a match context. The
+result is always zero.
+</P>
+<P>
+There is a complete description of the PCRE2 native API in the
+<a href="pcre2api.html"><b>pcre2api</b></a>
+page and a description of the POSIX API in the
+<a href="pcre2posix.html"><b>pcre2posix</b></a>
+page.
+<p>
+Return to the <a href="index.html">PCRE2 index page</a>.
+</p>


Modified: code/trunk/src/pcre2_match.c
===================================================================
--- code/trunk/src/pcre2_match.c    2017-04-11 11:47:25 UTC (rev 739)
+++ code/trunk/src/pcre2_match.c    2017-04-11 14:53:26 UTC (rev 740)
@@ -802,11 +802,15 @@
       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


Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2    2017-04-11 11:47:25 UTC (rev 739)
+++ code/trunk/testdata/testinput2    2017-04-11 14:53:26 UTC (rev 740)
@@ -5038,6 +5038,9 @@
 \= 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

Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2    2017-04-11 11:47:25 UTC (rev 739)
+++ code/trunk/testdata/testoutput2    2017-04-11 14:53:26 UTC (rev 740)
@@ -15574,6 +15574,10 @@
     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