summaryrefslogtreecommitdiff
path: root/pcrecpp.cc
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-01-04 19:44:00 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-01-04 19:44:00 +0000
commitef49ade6a6462bb4a9f673b20b28d79da9cea129 (patch)
tree02b2166c1d523bbaab291dfbb9da0d77977f7332 /pcrecpp.cc
parent5ee150b95d7dc6e69aaaec8aae623c32b2b069d2 (diff)
downloadpcre-ef49ade6a6462bb4a9f673b20b28d79da9cea129.tar.gz
Craig's patch for the double-counting bug in global replace.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@297 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcrecpp.cc')
-rw-r--r--pcrecpp.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcrecpp.cc b/pcrecpp.cc
index 498e0b3..a318d19 100644
--- a/pcrecpp.cc
+++ b/pcrecpp.cc
@@ -369,7 +369,7 @@ int RE::GlobalReplace(const StringPiece& rewrite,
int start = 0;
int lastend = -1;
- for (; start <= static_cast<int>(str->length()); count++) {
+ while (start <= static_cast<int>(str->length())) {
int matches = TryMatch(*str, start, UNANCHORED, vec, kVecSize);
if (matches <= 0)
break;
@@ -409,7 +409,7 @@ int RE::GlobalReplace(const StringPiece& rewrite,
Rewrite(&out, rewrite, *str, vec, matches);
start = matchend;
lastend = matchend;
- // count++; // Removed by PH 19-Dec-2007: duplicate count increment
+ count++;
}
}