]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modmanager_dynamic.cpp
Allow modules to be called as "foo" instead of "m_foo.so"
[user/henk/code/inspircd.git] / src / modmanager_dynamic.cpp
index 184013a4e0db3777957a85c9a636fe3fb6fbe5e5..9a687ad2bf1af38002134ff30aefc3f288ff6603 100644 (file)
 
 #ifndef PURE_STATIC
 
-bool ModuleManager::Load(const std::string& filename, bool defer)
+bool ModuleManager::Load(const std::string& modname, bool defer)
 {
        /* Don't allow people to specify paths for modules, it doesn't work as expected */
-       if (filename.find('/') != std::string::npos)
+       if (modname.find('/') != std::string::npos)
+       {
+               LastModuleError = "You can't load modules with a path: " + modname;
                return false;
+       }
 
+       const std::string filename = ExpandModName(modname);
        const std::string moduleFile = ServerInstance->Config->Paths.PrependModule(filename);
 
        if (!FileSystem::FileExists(moduleFile))