]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
a long road of uniformed messages ;)
[user/henk/code/inspircd.git] / src / command_parse.cpp
index fff8653b36986afa3bbed70430887ccddd936de0..9e54a63d9b84bfeaccdaf2ebd524b7d7f1e20ef0 100644 (file)
@@ -367,24 +367,15 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
        }
 }
 
-bool CommandParser::RemoveCommands(const char* source)
+void CommandParser::RemoveCommands(const char* source)
 {
        Commandable::iterator i,safei;
-       for (i = cmdlist.begin(); i != cmdlist.end(); i++)
+       for (i = cmdlist.begin(); i != cmdlist.end();)
        {
                safei = i;
-               safei++;
-               if (safei != cmdlist.end())
-               {
-                       RemoveCommand(safei, source);
-               }
-       }
-       safei = cmdlist.begin();
-       if (safei != cmdlist.end())
-       {
+               i++;
                RemoveCommand(safei, source);
        }
-       return true;
 }
 
 void CommandParser::RemoveCommand(Commandable::iterator safei, const char* source)
@@ -559,7 +550,7 @@ void CommandParser::SetupCommandTable(User* user)
        if (library)
        {
                dirent* entry = NULL;
-               while ((entry = readdir(library)))
+               while (0 != (entry = readdir(library)))
                {
                        if (match(entry->d_name, "cmd_*.so"))
                        {
@@ -663,3 +654,4 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st
        return translations;
 }
 
+