summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 7c9e5aa5c..e735ad828 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -742,9 +742,13 @@ void CommandParser::ProcessBuffer(const char* cmdbuf,userrec *user)
bool CommandParser::CreateCommand(command_t *f)
{
/* create the command and push it onto the table */
- cmdlist[f->command] = f;
- log(DEBUG,"Added command %s (%lu parameters)",f->command.c_str(),(unsigned long)f->min_params);
- return true;
+ if (cmdlist.find(f->command) != cmdlist.end())
+ {
+ cmdlist[f->command] = f;
+ log(DEBUG,"Added command %s (%lu parameters)",f->command.c_str(),(unsigned long)f->min_params);
+ return true;
+ }
+ else return false
}
CommandParser::CommandParser()