From 109c6434f5a6a05a77615e196811c507aa102fa5 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Mon, 13 Aug 2012 01:52:59 -0400 Subject: [PATCH] Code Cleanup - Recycle an object. - A second argument to task show now gives an error. --- src/commands/CmdShow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index a33638f9d..f65b241c7 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -60,7 +60,7 @@ int CmdShow::execute (std::string& output) // Obtain the arguments from the description. That way, things like '--' // have already been handled. std::vector words = context.a3.extract_words (); - if (words.size () > 2) + if (words.size () > 1) throw std::string (STRING_CMD_SHOW_ARGS); int width = context.getWidth (); @@ -276,9 +276,10 @@ int CmdShow::execute (std::string& output) if (section == "all") section = ""; + std::string::size_type loc; for (i = all.begin (); i != all.end (); ++i) { - std::string::size_type loc = i->find (section, 0); + loc = i->find (section, 0); if (loc != std::string::npos) { // Look for unrecognized.