summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-07-06 14:55:40 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-07-06 14:55:40 +0000
commit5a81f26cf832fa0900104fb3fb4a7d8c83dc6a42 (patch)
tree60f0e44d66b769245bb47c3f30526126fa6202a1
parent575b84a7bcbd63f54d933804ea5036642b93c0f7 (diff)
downloadpcre-5a81f26cf832fa0900104fb3fb4a7d8c83dc6a42.tar.gz
Ignore "show all captures" after DFA matching.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1661 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog2
-rw-r--r--pcretest.c17
-rw-r--r--testdata/testinput84
-rw-r--r--testdata/testoutput810
4 files changed, 28 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 5cdd73e..732d199 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,8 @@ Version 8.40 17-June-2016
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
-------------------------
diff --git a/pcretest.c b/pcretest.c
index 78ef517..5748c55 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -5042,7 +5042,7 @@ while (!done)
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 @@ while (!done)
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,
diff --git a/testdata/testinput8 b/testdata/testinput8
index 931dd71..7f8fa82 100644
--- a/testdata/testinput8
+++ b/testdata/testinput8
@@ -4841,4 +4841,8 @@
bbb
aaa
+/()()a+/O=
+ aaa\D
+ a\D
+
/-- End of testinput8 --/
diff --git a/testdata/testoutput8 b/testdata/testoutput8
index e4fa497..17b667a 100644
--- a/testdata/testoutput8
+++ b/testdata/testoutput8
@@ -7791,4 +7791,14 @@ Matched, but offsets vector is too small to show all matches
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 --/