summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-03-10 16:28:54 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-03-10 16:28:54 +0000
commit2c970c22d75c6b2fda321a918b607766a0c2d4f3 (patch)
tree6015fb3a50ce3f77c35c739237d98a4cc552329e
parent5f7a5d74fc05f33891a4e161f8e7af385838071a (diff)
downloadpcre-2c970c22d75c6b2fda321a918b607766a0c2d4f3.tar.gz
Fix typo that caused max/min quantifiers in ungreedy mode not to work.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1462 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog4
-rw-r--r--pcre_compile.c2
-rw-r--r--testdata/testinput23
-rw-r--r--testdata/testoutput24
4 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ef2cde..5099cc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -105,6 +105,10 @@ Version 8.35-RC1 04-March-2014
variable called pcre_stack_guard that can be set to point to an external
function to check stack availability. It is called at the start of
processing every parenthesized group.
+
+22. A typo in the code meant that in ungreedy mode the max/min qualifier
+ behaved like a min-possessive qualifier, and, for example, /a{1,3}b/U did
+ not match "ab".
Version 8.34 15-December-2013
diff --git a/pcre_compile.c b/pcre_compile.c
index 180a46c..8a5b723 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -3642,7 +3642,7 @@ for (;;)
break;
case OP_MINUPTO:
- *code += OP_MINUPTO - OP_UPTO;
+ *code += OP_POSUPTO - OP_MINUPTO;
break;
}
}
diff --git a/testdata/testinput2 b/testdata/testinput2
index 71df1a8..da6e614 100644
--- a/testdata/testinput2
+++ b/testdata/testinput2
@@ -907,6 +907,9 @@
/\U/I
+/a{1,3}b/U
+ ab
+
/[/I
/[a-/I
diff --git a/testdata/testoutput2 b/testdata/testoutput2
index e9d3265..b6da7df 100644
--- a/testdata/testoutput2
+++ b/testdata/testoutput2
@@ -3178,6 +3178,10 @@ Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
/\U/I
Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
+/a{1,3}b/U
+ ab
+ 0: ab
+
/[/I
Failed: missing terminating ] for character class at offset 1