From ff6a46391f29922476556f8f198730610f3707c2 Mon Sep 17 00:00:00 2001 From: Jim Ramsay Date: Wed, 8 Apr 2009 10:57:04 -0400 Subject: Error on incomplete MacroCmd key command --- src/FbTk/MacroCommand.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/FbTk/MacroCommand.cc b/src/FbTk/MacroCommand.cc index 511683b..555e5f5 100644 --- a/src/FbTk/MacroCommand.cc +++ b/src/FbTk/MacroCommand.cc @@ -33,16 +33,18 @@ namespace { template M *addCommands(M *macro, const std::string &args, bool trusted) { - std::string blah; + std::string remainder; std::list cmds; - StringUtil::stringTokensBetween(cmds, args, blah, '{', '}'); + StringUtil::stringTokensBetween(cmds, args, remainder, '{', '}'); RefCount > cmd(0); - std::list::iterator it = cmds.begin(), it_end = cmds.end(); - for (; it != it_end; ++it) { - cmd = CommandParser::instance().parse(*it, trusted); - if (*cmd) - macro->add(cmd); + if (remainder.length() == 0) { + std::list::iterator it = cmds.begin(), it_end = cmds.end(); + for (; it != it_end; ++it) { + cmd = CommandParser::instance().parse(*it, trusted); + if (*cmd) + macro->add(cmd); + } } if (macro->size() > 0) -- cgit v0.11.2