diff options
author | Brad King <brad.king@kitware.com> | 2002-11-06 23:05:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2002-11-06 23:05:39 (GMT) |
commit | 6ab16695d066278fe9f78774ec3df3733d932c06 (patch) | |
tree | efe7ecb05c7418013618a8d36577dd41c4d02815 /Source | |
parent | 42c464c05e8f79f82babf83909d918bf26317425 (diff) | |
download | CMake-6ab16695d066278fe9f78774ec3df3733d932c06.zip CMake-6ab16695d066278fe9f78774ec3df3733d932c06.tar.gz CMake-6ab16695d066278fe9f78774ec3df3733d932c06.tar.bz2 |
BUG: Fixed STRING(REGEX REPLACE ...) and added better test.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmStringCommand.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index f17e65a..73c6e60 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -254,7 +254,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) std::string::size_type r = re.end(); // Concatenate the part of the input that was not matched. - output += input.substr(base, l-base); + output += input.substr(base, l); // Make sure the match had some text. if(r-l == 0) @@ -282,7 +282,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) if((start != std::string::npos) && (end != std::string::npos) && (start >= 0) && (start <= len) && (end >= 0) && (end <= len)) { - output += input.substr(base+l, r-l); + output += input.substr(base+start, end-start); } else { |