From a2763a275c45d00b2d480cf965ba496e02bcab33 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 24 Aug 2014 13:25:12 -0400 Subject: [PATCH] Parser - Code cleanup for ::findCommand. --- src/Parser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Parser.cpp b/src/Parser.cpp index 5af4ea416..c0d7b0e0e 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -435,14 +435,15 @@ void Parser::findCommand () std::vector nodes; collect (nodes, collectAll); - // There can be only one. // Scan for an existing CMD tag, to short-circuit scanning for another. + // There can be only one. std::vector ::iterator i; for (i = nodes.begin (); i != nodes.end (); ++i) if ((*i)->hasTag ("CMD")) return; - // No CMD tag found, now look for a command. + // If no CMD tag was found, rescan all nodes and canonicalize args, looking + // for the first match. std::string command; for (i = nodes.begin (); i != nodes.end (); ++i) {