From a06dcdba970b5ea1cf570de1a9f7f038af849496 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Jan 2008 11:24:41 -0500 Subject: ENH: Allow LIST(APPEND) command to append nothing. --- Source/cmListCommand.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index c00f6eb..b7519ab 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -179,12 +179,18 @@ bool cmListCommand::HandleGetCommand(std::vector const& args) //---------------------------------------------------------------------------- bool cmListCommand::HandleAppendCommand(std::vector const& args) { - if(args.size() < 3) + if(args.size() < 2) { - this->SetError("sub-command APPEND requires at least two arguments."); + this->SetError("sub-command APPEND requires at least one argument."); return false; } + // Skip if nothing to append. + if(args.size() < 3) + { + return true; + } + const std::string& listName = args[1]; // expand the variable std::string listString; -- cgit v0.12