diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2012-08-15 20:12:12 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2012-08-15 20:12:12 (GMT) |
commit | 52d9c38e72a458bd3575aefab02694d5916bfd91 (patch) | |
tree | 7b53a4b9097cff60271cec05b6519378dbb6e4dd /Source/cmListCommand.cxx | |
parent | addefc2ae3b33a75a7152730146b46b319118a24 (diff) | |
download | CMake-52d9c38e72a458bd3575aefab02694d5916bfd91.zip CMake-52d9c38e72a458bd3575aefab02694d5916bfd91.tar.gz CMake-52d9c38e72a458bd3575aefab02694d5916bfd91.tar.bz2 |
list command: error on too many arguments
SORT, REVERSE, and REMOVE_DUPLICATES can only operate on exactly one argument.
Until now all other arguments were silently ignored. Give an error instead.
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r-- | Source/cmListCommand.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 9d4f175..7848424 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -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 |