diff options
author | Asit Dhal <dhal.asitk@gmail.com> | 2021-01-07 06:30:00 (GMT) |
---|---|---|
committer | Asit Dhal <dhal.asitk@gmail.com> | 2021-01-12 07:27:40 (GMT) |
commit | 38e2299fc84aa31ca73bebf1efc9123dbc7bee1a (patch) | |
tree | 00d285e77ec9638cc43f7cbdbed884dad2e2c9e2 /Source/cmListCommand.cxx | |
parent | 4f5a12be2924ceedc41c2da632e30e332f000f37 (diff) | |
download | CMake-38e2299fc84aa31ca73bebf1efc9123dbc7bee1a.zip CMake-38e2299fc84aa31ca73bebf1efc9123dbc7bee1a.tar.gz CMake-38e2299fc84aa31ca73bebf1efc9123dbc7bee1a.tar.bz2 |
list(REMOVE_ITEM): Make removal of an empty item a no-op.
Fixes: #21663
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r-- | Source/cmListCommand.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 53c871b..fdddb45 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -422,9 +422,10 @@ bool HandleJoinCommand(std::vector<std::string> const& args, bool HandleRemoveItemCommand(std::vector<std::string> const& args, cmExecutionStatus& status) { - if (args.size() < 3) { - status.SetError("sub-command REMOVE_ITEM requires two or more arguments."); - return false; + assert(args.size() >= 2); + + if (args.size() == 2) { + return true; } const std::string& listName = args[1]; |