diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2008-01-04 19:44:00 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2008-01-04 19:44:00 +0000 |
commit | ef49ade6a6462bb4a9f673b20b28d79da9cea129 (patch) | |
tree | 02b2166c1d523bbaab291dfbb9da0d77977f7332 /pcrecpp.cc | |
parent | 5ee150b95d7dc6e69aaaec8aae623c32b2b069d2 (diff) | |
download | pcre-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.cc | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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++; } } |