From 8b418f081f7ecbfdd51c84fae2298f927155fac0 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 10 Aug 2018 07:46:42 +0100 Subject: Split irc::tokenparser::GetToken into GetMiddle and GetTrailing. This simplifies the logic of irc::tokenparser considerably and removes all of the magic index guessing that was used previously. --- src/command_parse.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/command_parse.cpp') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 97980112e..fb8ea2565 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -164,7 +164,7 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd) CommandBase::Params command_p; irc::tokenstream tokens(cmd); std::string command, token; - tokens.GetToken(command); + tokens.GetMiddle(command); /* A client sent a nick prefix on their command (ick) * rhapsody and some braindead bouncers do this -- @@ -172,9 +172,9 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd) * discard it if they do. */ if (command[0] == ':') - tokens.GetToken(command); + tokens.GetMiddle(command); - while (tokens.GetToken(token)) + while (tokens.GetTrailing(token)) command_p.push_back(token); std::transform(command.begin(), command.end(), command.begin(), ::toupper); -- cgit v1.3.1-10-gc9f91