summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-21 21:31:20 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-21 21:31:20 +0000
commit984ae685724f26dad0865ad43773364c8b5128ff (patch)
tree84addc4437b175f9ed39332678f7435f30cfb9f3 /src/modules
parent48411d8c6b214282174519d5e31e8a4144c135cc (diff)
Updated m_alias to fix bug #92, updated configs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2603 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_alias.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index a0d361e78..59492c828 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -95,7 +95,6 @@ class ModuleAlias : public Module
for (unsigned int i = 0; i < Aliases.size(); i++)
{
- log(DEBUG,"Check against alias %s: %s",Aliases[i].text.c_str(),c.c_str());
if (Aliases[i].text == c)
{
if (Aliases[i].requires != "")
@@ -118,28 +117,26 @@ class ModuleAlias : public Module
}
}
- std::stringstream stuff(Aliases[i].replace_with);
- for (int j = 1; j < pcnt; j++)
+ std::string n = "";
+ for (int j = 0; j < pcnt; j++)
{
if (j)
- stuff << " ";
- stuff << parameters[j];
- }
-
- std::vector<std::string> items;
- while (!stuff.eof())
- {
- std::string data;
- stuff >> data;
- items.push_back(data);
+ n = n + " ";
+ n = n + parameters[j];
}
+ /* Final param now in n as one string */
+ std::stringstream stuff(Aliases[i].replace_with);
- char* para[127];
+ std::string cmd = "";
+ std::string target = "";
+ stuff >> cmd;
+ stuff >> target;
- for (unsigned int j = 1; j < items.size(); j++)
- para[j-1] = (char*)items[j].c_str();
+ char* para[2];
+ para[0] = (char*)target.c_str();
+ para[1] = (char*)n.c_str();
- Srv->CallCommandHandler(items[0],para,items.size()-1,user);
+ Srv->CallCommandHandler(cmd,para,2,user);
return 1;
}
}