From 976bf3c16569cd419ad79dcbfcc0f0e904761825 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 14 Mar 2009 15:00:23 +0000 Subject: Allow commands to be reloaded when they previously failed to load git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11219 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 2dfc7fac5..c8f5daef6 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -509,20 +509,17 @@ bool CommandParser::ReloadCommand(std::string cmd, User* user) std::transform(cmd.begin(), cmd.end(), cmd.begin(), ::tolower); delete cmdptr; dlclose(command->second); - - snprintf(filename, MAXBUF, "cmd_%s.so", cmd.c_str()); - const char* err = this->LoadCommand(filename); - if (err) - { - if (user) - user->WriteServ("NOTICE %s :*** Error loading 'cmd_%s.so': %s", user->nick.c_str(), cmd.c_str(), err); - return false; - } - - return true; } - return false; + snprintf(filename, MAXBUF, "cmd_%s.so", cmd.c_str()); + const char* err = this->LoadCommand(filename); + if (err) + { + if (user) + user->WriteServ("NOTICE %s :*** Error loading '%s': %s", user->nick.c_str(), filename, err); + return false; + } + return true; } CmdResult CommandReload::Handle(const std::vector& parameters, User *user) -- cgit v1.2.3