mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 17:19:05 -05:00
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:
committed by
Ben Boeckel
parent
02a8ea2d5b
commit
36cb701690
@@ -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 << " - "
|
||||
|
||||
Reference in New Issue
Block a user