diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2000-09-01 14:43:10 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2000-09-01 14:43:10 (GMT) |
commit | e2ad65d3c27177b8f3ee3c9b81382ea883a3bfbd (patch) | |
tree | f5cab775c20188328fd1e3b0d0d5b98a21d596c7 /Source/cmSystemTools.cxx | |
parent | c5e7d5a7963762ab5998e4d0a0edff826c85c6ea (diff) | |
download | CMake-e2ad65d3c27177b8f3ee3c9b81382ea883a3bfbd.zip CMake-e2ad65d3c27177b8f3ee3c9b81382ea883a3bfbd.tar.gz CMake-e2ad65d3c27177b8f3ee3c9b81382ea883a3bfbd.tar.bz2 |
BUG: fix release build on windows
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 4efb05d..49dc32b 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -40,13 +40,15 @@ void cmSystemTools::ReplaceString(std::string& source, const char* replace, const char* with) { - std::string line = source; - size_t start = line.find(replace); + int lengthReplace = strlen(replace); + std::string rest; + size_t start = source.find(replace); while(start != std::string::npos) { - source = line.substr(0, start); + rest = source.substr(start+lengthReplace); + source = source.substr(0, start); source += with; - source += line.substr(start + strlen(replace)); - start = line.find(replace, start + strlen(replace) ); + source += rest; + start = source.find(replace, start + lengthReplace ); } } |