diff options
author | Peter Powell <petpow@saberuk.com> | 2018-08-10 07:46:42 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-08-10 13:55:32 +0100 |
commit | 8b418f081f7ecbfdd51c84fae2298f927155fac0 (patch) | |
tree | b600035f9346e081482fe1cad75b12697b56ae4a /src/command_parse.cpp | |
parent | aa6912f1c9845386180df91b20b6ecd3b78ba4b9 (diff) |
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.
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); |