summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-11-11 17:27:22 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-11-11 17:27:22 +0000
commitf1660e461ec9b5150d4b59c8423261dab447f165 (patch)
tree191aef38ee6dbb93862c539c1d5f975ec4ddc0fe
parente95986b1e5330fb661544200997dff26d06b2548 (diff)
downloadpcre-f1660e461ec9b5150d4b59c8423261dab447f165.tar.gz
Fix really stupid bug in multicase matching, and deficiency in the tests.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1218 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--pcre_dfa_exec.c8
-rw-r--r--pcre_exec.c8
-rw-r--r--testdata/testinput1016
-rw-r--r--testdata/testinput716
-rw-r--r--testdata/testoutput1022
-rw-r--r--testdata/testoutput730
6 files changed, 92 insertions, 8 deletions
diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c
index 91c0702..98a2798 100644
--- a/pcre_dfa_exec.c
+++ b/pcre_dfa_exec.c
@@ -1112,7 +1112,7 @@ for (;;)
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + code[2];
for (;;)
{
if (c < *cp) { OK = FALSE; break; }
@@ -1356,7 +1356,7 @@ for (;;)
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + code[3];
for (;;)
{
if (c < *cp) { OK = FALSE; break; }
@@ -1594,7 +1594,7 @@ for (;;)
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + code[3];
for (;;)
{
if (c < *cp) { OK = FALSE; break; }
@@ -1857,7 +1857,7 @@ for (;;)
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + code[1 + IMM2_SIZE + 2];
for (;;)
{
if (c < *cp) { OK = FALSE; break; }
diff --git a/pcre_exec.c b/pcre_exec.c
index ca57406..e4059c0 100644
--- a/pcre_exec.c
+++ b/pcre_exec.c
@@ -2594,7 +2594,7 @@ for (;;)
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + ecode[2];
for (;;)
{
if (c < *cp)
@@ -4214,7 +4214,7 @@ for (;;)
RRETURN(MATCH_NOMATCH);
}
GETCHARINCTEST(c, eptr);
- cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);
+ cp = PRIV(ucd_caseless_sets) + prop_value;
for (;;)
{
if (c < *cp)
@@ -4965,7 +4965,7 @@ for (;;)
RRETURN(MATCH_NOMATCH);
}
GETCHARINCTEST(c, eptr);
- cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);
+ cp = PRIV(ucd_caseless_sets) + prop_value;
for (;;)
{
if (c < *cp)
@@ -5457,7 +5457,7 @@ for (;;)
break;
}
GETCHARLENTEST(c, eptr, len);
- cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);
+ cp = PRIV(ucd_caseless_sets) + prop_value;
for (;;)
{
if (c < *cp)
diff --git a/testdata/testinput10 b/testdata/testinput10
index 9793d7d..f20dcb3 100644
--- a/testdata/testinput10
+++ b/testdata/testinput10
@@ -1318,4 +1318,20 @@
/\x{017f}+/8i
\x{0053}\x{0073}\x{017f}
+/ist/8i
+ ikt
+
+/is+t/8i
+ iSs\x{17f}t
+ ikt
+
+/is+?t/8i
+ ikt
+
+/is?t/8i
+ ikt
+
+/is{2}t/8i
+ iskt
+
/-- End of testinput10 --/
diff --git a/testdata/testinput7 b/testdata/testinput7
index 3180275..b265f1f 100644
--- a/testdata/testinput7
+++ b/testdata/testinput7
@@ -653,4 +653,20 @@ of case for anything other than the ASCII letters. --/
/[^a]*\x{3c2}/8iBZ
+/ist/8iBZ
+ ikt
+
+/is+t/8i
+ iSs\x{17f}t
+ ikt
+
+/is+?t/8i
+ ikt
+
+/is?t/8i
+ ikt
+
+/is{2}t/8i
+ iskt
+
/-- End of testinput7 --/
diff --git a/testdata/testoutput10 b/testdata/testoutput10
index 53eaffb..049d446 100644
--- a/testdata/testoutput10
+++ b/testdata/testoutput10
@@ -2701,4 +2701,26 @@ Partial match: AA
1: Ss
2: S
+/ist/8i
+ ikt
+No match
+
+/is+t/8i
+ iSs\x{17f}t
+ 0: iSs\x{17f}t
+ ikt
+No match
+
+/is+?t/8i
+ ikt
+No match
+
+/is?t/8i
+ ikt
+No match
+
+/is{2}t/8i
+ iskt
+No match
+
/-- End of testinput10 --/
diff --git a/testdata/testoutput7 b/testdata/testoutput7
index 2648dc5..4f8b7b9 100644
--- a/testdata/testoutput7
+++ b/testdata/testoutput7
@@ -1440,4 +1440,34 @@ No match
End
------------------------------------------------------------------
+/ist/8iBZ
+------------------------------------------------------------------
+ Bra
+ /i i
+ clist 0053 0073 017f
+ /i t
+ Ket
+ End
+------------------------------------------------------------------
+ ikt
+No match
+
+/is+t/8i
+ iSs\x{17f}t
+ 0: iSs\x{17f}t
+ ikt
+No match
+
+/is+?t/8i
+ ikt
+No match
+
+/is?t/8i
+ ikt
+No match
+
+/is{2}t/8i
+ iskt
+No match
+
/-- End of testinput7 --/