From bf572ac952d7ddf2b7208efc56f104844aea72e2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 11 Oct 2018 17:22:45 -0400 Subject: cmListCommand: check list(FILTER) operation before the list A future commit will make the not-a-list case a success, but invalid operations should still be diagnosed in that case. --- Source/cmListCommand.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index d7de2fa..b9c7ada 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -1289,14 +1289,6 @@ bool cmListCommand::HandleFilterCommand(std::vector const& args) return false; } - const std::string& listName = args[1]; - // expand the variable - std::vector varArgsExpanded; - if (!this->GetList(varArgsExpanded, listName)) { - this->SetError("sub-command FILTER requires list to be present."); - return false; - } - const std::string& op = args[2]; bool includeMatches; if (op == "INCLUDE") { @@ -1308,6 +1300,14 @@ bool cmListCommand::HandleFilterCommand(std::vector const& args) return false; } + const std::string& listName = args[1]; + // expand the variable + std::vector varArgsExpanded; + if (!this->GetList(varArgsExpanded, listName)) { + this->SetError("sub-command FILTER requires list to be present."); + return false; + } + const std::string& mode = args[3]; if (mode == "REGEX") { if (args.size() != 5) { -- cgit v0.12