aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/MacroCommand.cc16
1 files 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 {
33template <typename M> 33template <typename M>
34M *addCommands(M *macro, const std::string &args, bool trusted) { 34M *addCommands(M *macro, const std::string &args, bool trusted) {
35 35
36 std::string blah; 36 std::string remainder;
37 std::list<std::string> cmds; 37 std::list<std::string> cmds;
38 StringUtil::stringTokensBetween(cmds, args, blah, '{', '}'); 38 StringUtil::stringTokensBetween(cmds, args, remainder, '{', '}');
39 RefCount<Command<void> > cmd(0); 39 RefCount<Command<void> > cmd(0);
40 40
41 std::list<std::string>::iterator it = cmds.begin(), it_end = cmds.end(); 41 if (remainder.length() == 0) {
42 for (; it != it_end; ++it) { 42 std::list<std::string>::iterator it = cmds.begin(), it_end = cmds.end();
43 cmd = CommandParser<void>::instance().parse(*it, trusted); 43 for (; it != it_end; ++it) {
44 if (*cmd) 44 cmd = CommandParser<void>::instance().parse(*it, trusted);
45 macro->add(cmd); 45 if (*cmd)
46 macro->add(cmd);
47 }
46 } 48 }
47 49
48 if (macro->size() > 0) 50 if (macro->size() > 0)