ENH: Allow LIST(APPEND) command to append nothing.

This commit is contained in:
Brad King 2008-01-16 11:24:41 -05:00
parent a5ac316155
commit a06dcdba97
1 changed files with 8 additions and 2 deletions

View File

@ -179,10 +179,16 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmListCommand::HandleAppendCommand(std::vector<std::string> const& args) bool cmListCommand::HandleAppendCommand(std::vector<std::string> const& args)
{ {
if(args.size() < 2)
{
this->SetError("sub-command APPEND requires at least one argument.");
return false;
}
// Skip if nothing to append.
if(args.size() < 3) if(args.size() < 3)
{ {
this->SetError("sub-command APPEND requires at least two arguments."); return true;
return false;
} }
const std::string& listName = args[1]; const std::string& listName = args[1];