BUG: end is not really end, but rather length
This commit is contained in:
parent
1e6431801c
commit
097debb55a
|
@ -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;
|
||||
|
|
|
@ -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 "
|
||||
|
|
Loading…
Reference in New Issue