mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Fix RemoveCommands to remove all commands (this function had some really odd removal logic?)
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@9555 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
4e0faf2713
commit
e3175d0747
@ -182,9 +182,8 @@ class CoreExport CommandParser : public classbase
|
|||||||
|
|
||||||
/** Remove all commands relating to module 'source'.
|
/** Remove all commands relating to module 'source'.
|
||||||
* @param source A module name which has introduced new commands
|
* @param source A module name which has introduced new commands
|
||||||
* @return True This function returns true if commands were removed
|
|
||||||
*/
|
*/
|
||||||
bool RemoveCommands(const char* source);
|
void RemoveCommands(const char* source);
|
||||||
|
|
||||||
/** Add a new command to the commands hash
|
/** Add a new command to the commands hash
|
||||||
* @param f The new command_t to add to the list
|
* @param f The new command_t to add to the list
|
||||||
|
@ -379,21 +379,13 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CommandParser::RemoveCommands(const char* source)
|
void CommandParser::RemoveCommands(const char* source)
|
||||||
{
|
{
|
||||||
command_table::iterator i,safei;
|
command_table::iterator i,safei;
|
||||||
for (i = cmdlist.begin(); i != cmdlist.end(); i++)
|
for (i = cmdlist.begin(); i != cmdlist.end();)
|
||||||
{
|
{
|
||||||
safei = i;
|
safei = i;
|
||||||
safei++;
|
i++;
|
||||||
if (safei != cmdlist.end())
|
|
||||||
{
|
|
||||||
RemoveCommand(safei, source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
safei = cmdlist.begin();
|
|
||||||
if (safei != cmdlist.end())
|
|
||||||
{
|
|
||||||
RemoveCommand(safei, source);
|
RemoveCommand(safei, source);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user