BUG: end is not really end, but rather length

This commit is contained in:
Bill Hoffman 2005-10-20 10:11:03 -04:00
parent 1e6431801c
commit 097debb55a
2 changed files with 2 additions and 2 deletions

View File

@ -555,7 +555,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const& arg
return false;
}
int leftOverLength = intStringLength - begin;
if ( end < 0 || end > intStringLength )
if ( end < 0 || end > leftOverLength )
{
cmOStringStream ostr;
ostr << "end index: " << end << " is out of range " << 0 << " - " << leftOverLength;

View File

@ -84,7 +84,7 @@ public:
" STRING(TOUPPER <string1> <output variable>)\n"
" STRING(TOLOWER <string1> <output variable>)\n"
" STRING(LENGTH <string> <output variable>)\n"
" STRING(SUBSTRING <string> <begin> <end> <output variable>)\n"
" STRING(SUBSTRING <string> <begin> <length> <output variable>)\n"
"REGEX MATCH will match the regular expression once and store the "
"match in the output variable.\n"
"REGEX MATCHALL will match the regular expression as many times as "