summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-23 18:06:26 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-23 18:06:26 +0000
commitdeb85740798d3438563628736c0e83edb6966b6e (patch)
treea8ad119fa9d1624a174cded210aba05a1af36173 /src/command_parse.cpp
parent3f3d3d302899aacf8b49fcc871265c965d1fb0fc (diff)
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
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp12
1 files changed, 7 insertions, 5 deletions
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())
{