allow STRING(SUBSTRING) work with length -1 as "rest of the string"

This fixes the first half of bug 10740.
This commit is contained in:
Rolf Eike Beer
2010-07-04 18:56:05 +02:00
committed by Ben Boeckel
parent 02a8ea2d5b
commit 36cb701690
2 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -606,7 +606,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const&
return false;
}
int leftOverLength = intStringLength - begin;
if ( end < 0 || end > leftOverLength )
if ( end < -1 || end > leftOverLength )
{
cmOStringStream ostr;
ostr << "end index: " << end << " is out of range " << 0 << " - "