diff options
| author | 2020-04-09 18:06:50 +0100 | |
|---|---|---|
| committer | 2020-04-09 18:06:50 +0100 | |
| commit | e1ed9b275f465fbc235a23e416ba7626c7cba6cc (patch) | |
| tree | a0cda4ca3cf14e2731ada5cd6fc890eb90e80731 /src/modules.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
| parent | Set the minimum length to 1 for most config items with a default. (diff) | |
| download | inspircd++-e1ed9b275f465fbc235a23e416ba7626c7cba6cc.tar.gz inspircd++-e1ed9b275f465fbc235a23e416ba7626c7cba6cc.tar.bz2 inspircd++-e1ed9b275f465fbc235a23e416ba7626c7cba6cc.zip | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules.cpp')
| -rw-r--r-- | src/modules.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 28729ba63..eb33267de 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -613,12 +613,13 @@ ServiceProvider* ModuleManager::FindService(ServiceType type, const std::string& std::string ModuleManager::ExpandModName(const std::string& modname) { - // Transform "callerid" -> "m_callerid.so" unless it already has a ".so" extension, - // so coremods in the "core_*.so" form aren't changed - std::string ret = modname; - if ((modname.length() < 3) || (modname.compare(modname.size() - 3, 3, ".so"))) - ret.insert(0, "m_").append(".so"); - return ret; + std::string fullname; + if (modname.compare(0, 5, "core_") != 0 && modname.compare(0, 2, "m_") != 0) + fullname.append("m_"); + fullname.append(modname); + if (modname.length() < 3 || modname.compare(modname.size() - 3, 3, ".so") != 0) + fullname.append(".so"); + return fullname; } dynamic_reference_base::dynamic_reference_base(Module* Creator, const std::string& Name) |
