summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorJohn Biddiscombe <jbiddiscombe@skippingmouse.co.uk>2002-04-08 23:31:21 (GMT)
committerJohn Biddiscombe <jbiddiscombe@skippingmouse.co.uk>2002-04-08 23:31:21 (GMT)
commit7d8d326d93130cd3db19a5b510736e8af30762ca (patch)
treebd8ba80bb8622c85e7f9830af4e6d2b3c6597bee /Source/cmSystemTools.cxx
parent2c276fcb137966566813bed3ef893a1501835ef3 (diff)
downloadCMake-7d8d326d93130cd3db19a5b510736e8af30762ca.zip
CMake-7d8d326d93130cd3db19a5b510736e8af30762ca.tar.gz
CMake-7d8d326d93130cd3db19a5b510736e8af30762ca.tar.bz2
ERR: ReplaceString didn't work properly if replace was longer than with as
length added to start pos on next search was replaceLength instead of withLength
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 0b05373..22acac8 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -182,6 +182,7 @@ void cmSystemTools::ReplaceString(std::string& source,
const char* with)
{
std::string::size_type lengthReplace = strlen(replace);
+ std::string::size_type lengthWith = strlen(with);
std::string rest;
std::string::size_type start = source.find(replace);
while(start != std::string::npos)
@@ -190,7 +191,7 @@ void cmSystemTools::ReplaceString(std::string& source,
source = source.substr(0, start);
source += with;
source += rest;
- start = source.find(replace, start + lengthReplace );
+ start = source.find(replace, start + lengthWith );
}
}