Error on incomplete MacroCmd key command

This commit is contained in:
Jim Ramsay 2009-04-08 10:57:04 -04:00
parent a56e409b1f
commit ff6a46391f

View file

@ -33,16 +33,18 @@ namespace {
template <typename M>
M *addCommands(M *macro, const std::string &args, bool trusted) {
std::string blah;
std::string remainder;
std::list<std::string> cmds;
StringUtil::stringTokensBetween(cmds, args, blah, '{', '}');
StringUtil::stringTokensBetween(cmds, args, remainder, '{', '}');
RefCount<Command<void> > cmd(0);
std::list<std::string>::iterator it = cmds.begin(), it_end = cmds.end();
for (; it != it_end; ++it) {
cmd = CommandParser<void>::instance().parse(*it, trusted);
if (*cmd)
macro->add(cmd);
if (remainder.length() == 0) {
std::list<std::string>::iterator it = cmds.begin(), it_end = cmds.end();
for (; it != it_end; ++it) {
cmd = CommandParser<void>::instance().parse(*it, trusted);
if (*cmd)
macro->add(cmd);
}
}
if (macro->size() > 0)