[Pcre-svn] [1661] code/trunk: Ignore "show all captures" aft…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1661] code/trunk: Ignore "show all captures" after DFA matching.
Revision: 1661
          http://vcs.pcre.org/viewvc?view=rev&revision=1661
Author:   ph10
Date:     2016-07-06 15:55:40 +0100 (Wed, 06 Jul 2016)
Log Message:
-----------
Ignore "show all captures" after DFA matching.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcretest.c
    code/trunk/testdata/testinput8
    code/trunk/testdata/testoutput8


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2016-07-01 09:06:38 UTC (rev 1660)
+++ code/trunk/ChangeLog    2016-07-06 14:55:40 UTC (rev 1661)
@@ -15,7 +15,9 @@


3. Fix register overwite in JIT when SSE2 acceleration is enabled.

+4. Ignore "show all captures" (/=) for DFA matching.

+
Version 8.39 14-June-2016
-------------------------


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2016-07-01 09:06:38 UTC (rev 1660)
+++ code/trunk/pcretest.c    2016-07-06 14:55:40 UTC (rev 1661)
@@ -5042,7 +5042,7 @@


     if ((all_use_dfa || use_dfa) && find_match_limit)
       {
-      printf("**Match limit not relevant for DFA matching: ignored\n");
+      printf("** Match limit not relevant for DFA matching: ignored\n");
       find_match_limit = 0;
       }


@@ -5255,10 +5255,17 @@

         if (do_allcaps)
           {
-          if (new_info(re, NULL, PCRE_INFO_CAPTURECOUNT, &count) < 0)
-            goto SKIP_DATA;
-          count++;   /* Allow for full match */
-          if (count * 2 > use_size_offsets) count = use_size_offsets/2;
+          if (all_use_dfa || use_dfa)
+            {
+            fprintf(outfile, "** Show all captures ignored after DFA matching\n");
+            }
+          else
+           {
+            if (new_info(re, NULL, PCRE_INFO_CAPTURECOUNT, &count) < 0)
+              goto SKIP_DATA;
+            count++;   /* Allow for full match */
+            if (count * 2 > use_size_offsets) count = use_size_offsets/2;
+            }
           }


         /* Output the captured substrings. Note that, for the matched string,


Modified: code/trunk/testdata/testinput8
===================================================================
--- code/trunk/testdata/testinput8    2016-07-01 09:06:38 UTC (rev 1660)
+++ code/trunk/testdata/testinput8    2016-07-06 14:55:40 UTC (rev 1661)
@@ -4841,4 +4841,8 @@
     bbb
     aaa 


+/()()a+/O=
+    aaa\D
+    a\D
+
 /-- End of testinput8 --/


Modified: code/trunk/testdata/testoutput8
===================================================================
--- code/trunk/testdata/testoutput8    2016-07-01 09:06:38 UTC (rev 1660)
+++ code/trunk/testdata/testoutput8    2016-07-06 14:55:40 UTC (rev 1661)
@@ -7791,4 +7791,14 @@
     aaa 
 No match


+/()()a+/O=
+    aaa\D
+** Show all captures ignored after DFA matching
+ 0: aaa
+ 1: aa
+ 2: a
+    a\D
+** Show all captures ignored after DFA matching
+ 0: a
+
 /-- End of testinput8 --/