From e3175d07479bc390cb67079d4f825eb68ec40c58 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 20 Apr 2008 19:00:08 +0000 Subject: 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 --- src/command_parse.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/command_parse.cpp') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 587133975..7a5df7d09 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -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; - 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; -- cgit v1.3.1-10-gc9f91