diff options
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/MacroCommand.cc | 16 | ||||
-rw-r--r-- | src/FbTk/StringUtil.hh | 2 |
2 files changed, 10 insertions, 8 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 { | |||
33 | template <typename M> | 33 | template <typename M> |
34 | M *addCommands(M *macro, const std::string &args, bool trusted) { | 34 | M *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) |
diff --git a/src/FbTk/StringUtil.hh b/src/FbTk/StringUtil.hh index 75fa69e..35f23a2 100644 --- a/src/FbTk/StringUtil.hh +++ b/src/FbTk/StringUtil.hh | |||
@@ -84,7 +84,7 @@ static void stringTokensBetween(Container &container, const std::string &in, | |||
84 | while (true) { | 84 | while (true) { |
85 | err = getStringBetween(token, in.c_str() + pos, first, last, ok_chars, | 85 | err = getStringBetween(token, in.c_str() + pos, first, last, ok_chars, |
86 | allow_nesting); | 86 | allow_nesting); |
87 | if (err == 0) | 87 | if (err <= 0) |
88 | break; | 88 | break; |
89 | container.push_back(token); | 89 | container.push_back(token); |
90 | pos += err; | 90 | pos += err; |