X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodmanager_dynamic.cpp;h=644d2140f614435dbc9e51f286fc34fb22ded050;hb=b0654ef6abd8d976fcbadce24ea350f7c420fe08;hp=184013a4e0db3777957a85c9a636fe3fb6fbe5e5;hpb=82435b6fa8805baa65e04a582f3e4a2c84237f73;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp index 184013a4e..644d2140f 100644 --- a/src/modmanager_dynamic.cpp +++ b/src/modmanager_dynamic.cpp @@ -25,14 +25,18 @@ #include #endif -#ifndef PURE_STATIC +#ifndef INSPIRCD_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)) @@ -67,6 +71,8 @@ bool ModuleManager::Load(const std::string& filename, bool defer) newmod->dying = false; Modules[filename] = newmod; std::string version = newhandle->GetVersion(); + if (version.empty()) + version.assign("unknown"); if (defer) { ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "New module introduced: %s (Module version %s)",