- Modified ::injectDefault to use Lexer::token_split instead of
  Lexer::word_split which allows stranger default commands. Not sure if this
  is necessary, but it seems like the right thing.
This commit is contained in:
Paul Beckingham 2014-05-31 13:54:56 -04:00
parent f4605a1bc7
commit 5ac3db3168

View file

@ -313,6 +313,7 @@ void Parser::findCommand ()
else if (exactMatch ("readcmd", command)) (*i)->tag ("READCMD"); else if (exactMatch ("readcmd", command)) (*i)->tag ("READCMD");
else if (exactMatch ("helper", command)) (*i)->tag ("HELPER"); else if (exactMatch ("helper", command)) (*i)->tag ("HELPER");
// Stop at the first command found.
return; return;
} }
} }
@ -468,7 +469,7 @@ void Parser::injectDefaults ()
// because captureFirst inserts args immediately after the command, and // because captureFirst inserts args immediately after the command, and
// so has the effect of reversing the list. // so has the effect of reversing the list.
std::vector <std::string> args; std::vector <std::string> args;
Lexer::word_split (args, defaultCommand); Lexer::token_split (args, defaultCommand);
std::vector <std::string>::reverse_iterator r; std::vector <std::string>::reverse_iterator r;
for (r = args.rbegin (); r != args.rend (); ++r) for (r = args.rbegin (); r != args.rend (); ++r)
{ {