From deb85740798d3438563628736c0e83edb6966b6e Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 23 Aug 2007 18:06:26 +0000 Subject: Add some stuff to change how we process a token sepeperated stream git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7800 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/command_parse.cpp') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index b333084e7..8a6149a2c 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -134,14 +134,15 @@ int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** p */ irc::commasepstream items1(parameters[splithere]); irc::commasepstream items2(parameters[extra]); - std::string item("*"); + std::string extrastuff; + std::string item; unsigned int max = 0; /* Attempt to iterate these lists and call the command objech * which called us, for every parameter pair until there are * no more left to parse. */ - while (((item = items1.GetToken()) != "") && (max++ < ServerInstance->Config->MaxTargets)) + while (items1.GetToken(item) && (max++ < ServerInstance->Config->MaxTargets)) { if (dupes.find(item.c_str()) == dupes.end()) { @@ -150,7 +151,8 @@ int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** p for (int t = 0; (t < pcnt) && (t < MAXPARAMETERS); t++) new_parameters[t] = parameters[t]; - std::string extrastuff = items2.GetToken(); + if (!items2.GetToken(extrastuff)) + extrastuff = ""; new_parameters[splithere] = item.c_str(); new_parameters[extra] = extrastuff.c_str(); @@ -175,14 +177,14 @@ int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** p /* Only one commasepstream here */ irc::commasepstream items1(parameters[splithere]); - std::string item("*"); + std::string item; unsigned int max = 0; /* Parse the commasepstream until there are no tokens remaining. * Each token we parse out, call the command handler that called us * with it */ - while (((item = items1.GetToken()) != "") && (max++ < ServerInstance->Config->MaxTargets)) + while (items1.GetToken(item) && (max++ < ServerInstance->Config->MaxTargets)) { if (dupes.find(item.c_str()) == dupes.end()) { -- cgit v1.3.1-10-gc9f91