diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-14 15:00:23 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-14 15:00:23 +0000 |
commit | 976bf3c16569cd419ad79dcbfcc0f0e904761825 (patch) | |
tree | b7ebb24987471bf7a07d7e96cddde3f3c1b21899 /src | |
parent | 2c3f10316c1fcfd137d83ecfe302d3ffeaad3e6f (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/command_parse.cpp | 21 |
1 files 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<std::string>& parameters, User *user) |