summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-12-19 12:21:45 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-12-19 12:21:45 +0000
commit8f950d0c993f85b219fb5148b481f8f87250f730 (patch)
tree73a5d7b4fbab313f248ed9fe81c4f0732361b0d3
parent2fc0e1b0bbcf143d0d3664d7ed9ba8d41e6fcb0d (diff)
downloadpcre-8f950d0c993f85b219fb5148b481f8f87250f730.tar.gz
Fix C++ GlobalReplace() double-counting bug.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@288 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog4
-rw-r--r--pcrecpp.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 174ab38..3df9102 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -95,6 +95,10 @@ Version 7.5 12-Nov-07
18. Added --enable-pcretest-libreadline.
+19. In pcrecpp.cc, the variable 'count' was incremented twice in
+ RE::GlobalReplace(). As a result, the number of replacements returned was
+ double what it should be. I have removed one of the increments.
+
Version 7.4 21-Sep-07
---------------------
diff --git a/pcrecpp.cc b/pcrecpp.cc
index 5265ff2..498e0b3 100644
--- a/pcrecpp.cc
+++ b/pcrecpp.cc
@@ -409,7 +409,7 @@ int RE::GlobalReplace(const StringPiece& rewrite,
Rewrite(&out, rewrite, *str, vec, matches);
start = matchend;
lastend = matchend;
- count++;
+ // count++; // Removed by PH 19-Dec-2007: duplicate count increment
}
}