Merge topic 'list-command-argument-fixes'

08c71ac CMake.List test: explicitely test with lists containing only an empty string
52d9c38 list command: error on too many arguments
This commit is contained in:
David Cole
2012-08-20 15:39:35 -04:00
committed by CMake Topic Stage
2 changed files with 29 additions and 0 deletions
+18
View File
@@ -429,6 +429,12 @@ bool cmListCommand
this->SetError("sub-command REVERSE requires a list as an argument.");
return false;
}
else if(args.size() > 2)
{
this->SetError(
"sub-command REVERSE only takes one argument.");
return false;
}
const std::string& listName = args[1];
// expand the variable
@@ -463,6 +469,12 @@ bool cmListCommand
"sub-command REMOVE_DUPLICATES requires a list as an argument.");
return false;
}
else if(args.size() > 2)
{
this->SetError(
"sub-command REMOVE_DUPLICATES only takes one argument.");
return false;
}
const std::string& listName = args[1];
// expand the variable
@@ -506,6 +518,12 @@ bool cmListCommand
this->SetError("sub-command SORT requires a list as an argument.");
return false;
}
else if(args.size() > 2)
{
this->SetError(
"sub-command SORT only takes one argument.");
return false;
}
const std::string& listName = args[1];
// expand the variable