diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-06-04 00:03:29 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-06-04 00:03:29 +0200 |
commit | 9b9326ff08565c6cf4acdc865884cc7c1f426822 (patch) | |
tree | 2454f2f73c99df2a337eae7d0a936d70dac77ded | |
parent | 1e68ff30df59dc1e063a678134705d177b2e4562 (diff) |
Expand module names in ServerConfig::ApplyModules()
-rw-r--r-- | include/modules.h | 14 | ||||
-rw-r--r-- | src/configreader.cpp | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/include/modules.h b/include/modules.h index 7944aa609..c938e6a9d 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1047,13 +1047,6 @@ class CoreExport ModuleManager : public fakederef<ModuleManager> */ bool PrioritizeHooks(); - /** Expands the name of a module by prepending "m_" and appending ".so". - * No-op if the name already has the ".so" extension. - * @param modname Module name to expand - * @return Module name starting with "m_" and ending with ".so" - */ - static std::string ExpandModName(const std::string& modname); - public: typedef std::map<std::string, Module*> ModuleMap; @@ -1075,6 +1068,13 @@ class CoreExport ModuleManager : public fakederef<ModuleManager> */ ServiceList* NewServices; + /** Expands the name of a module by prepending "m_" and appending ".so". + * No-op if the name already has the ".so" extension. + * @param modname Module name to expand + * @return Module name starting with "m_" and ending with ".so" + */ + static std::string ExpandModName(const std::string& modname); + /** Simple, bog-standard, boring constructor. */ ModuleManager(); diff --git a/src/configreader.cpp b/src/configreader.cpp index 68495623c..974e52abf 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -671,6 +671,7 @@ void ServerConfig::ApplyModules(User* user) std::string name; if (tag->readString("name", name)) { + name = ModuleManager::ExpandModName(name); // if this module is already loaded, the erase will succeed, so we need do nothing // otherwise, we need to add the module (which will be done later) if (removed_modules.erase(name) == 0) |