From 984ae685724f26dad0865ad43773364c8b5128ff Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 21 Dec 2005 21:31:20 +0000 Subject: 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 --- src/modules/m_alias.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'src/modules/m_alias.cpp') 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 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; } } -- cgit v1.2.3