]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alias.cpp
Make User:: nick/ident/dhost/fullname and some other things std::string instead of...
[user/henk/code/inspircd.git] / src / modules / m_alias.cpp
index ffe2946a5fc12604ebfad0e0c3393169fd6a3eff..1eb78023e388480369a841143a960a93be719de1 100644 (file)
@@ -74,8 +74,6 @@ class ModuleAlias : public Module
                : Module(Me)
        {
                ReadAliases();
-               pars.resize(MAXPARAMETERS);
-
                Me->Modules->Attach(I_OnPreCommand, this);
                Me->Modules->Attach(I_OnRehash, this);
 
@@ -159,7 +157,7 @@ class ModuleAlias : public Module
                                /* Does it match the pattern? */
                                if (!Aliases[i].format.empty())
                                {
-                                       if (!match(Aliases[i].case_sensitive, compare.c_str(), Aliases[i].format.c_str()))
+                                       if (!match(Aliases[i].case_sensitive, compare, Aliases[i].format))
                                                continue;
                                }
 
@@ -247,15 +245,15 @@ class ModuleAlias : public Module
                SearchAndReplace(newline, "\r", "$");
 
                irc::tokenstream ss(newline);
+               pars.clear();
+               std::string command, token;
 
-               std::vector<std::string> parms;
-               int x = 1;
-               while (ss.GetToken(pars[x]) && parms.size() <= MAXPARAMETERS)
+               ss.GetToken(command);
+               while (ss.GetToken(token) && (pars.size() <= MAXPARAMETERS))
                {
-                       parms.push_back(pars[x]);
-                       x++;
+                       pars.push_back(token);
                }
-               ServerInstance->Parser->CallHandler(pars[0], parms, user);
+               ServerInstance->Parser->CallHandler(command, pars, user);
        }
  
        virtual void OnRehash(User* user, const std::string &parameter)