summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
authorGravatar brain2007-08-23 18:06:50 +0000
committerGravatar brain2007-08-23 18:06:50 +0000
commitb72653db1a75223699050145be060e5481ecead9 (patch)
tree25d647bef0ca7aceea8da3ae555ff1051f22914e /src/command_parse.cpp
parentFix for irc::sepstream for when there are multiple seperators in a row, do no... (diff)
Add some stuff to change how we process a token sepeperated stream
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@7801 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 10c22dbfb..13d033330 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 < 127); 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())
{