From e13e45dc66c10da9fb3c2d96a1d0702eeb7ab0bb Mon Sep 17 00:00:00 2001 From: prozacx Date: Sun, 3 Apr 2005 23:18:52 +0000 Subject: [PATCH] Handle modules not being defined in LoadModule() and UnloadModule() git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@92 726aef4b-f618-498e-8847-2d620e286838 --- Modules.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules.cpp b/Modules.cpp index 7e096dec..ff5bbcf8 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -478,6 +478,10 @@ CModule* CModules::FindModule(const string& sModule) { } bool CModules::LoadModule(const string& sModule, const string& sArgs, CUser* pUser, string& sRetMsg) { +#ifndef _MODULES + sRetMsg = "Unable to load module [" + sModule + "] module support was not enabled."; + return false; +#else sRetMsg = ""; if (!pUser) { @@ -559,9 +563,14 @@ bool CModules::LoadModule(const string& sModule, const string& sArgs, CUser* pUs sRetMsg = "Loaded module [" + sModule + "] [" + sModPath + "]"; return true; +#endif // !_MODULES } bool CModules::UnloadModule(const string& sModule, string& sRetMsg) { +#ifndef _MODULES + sRetMsg = "Unable to unload module [" + sModule + "] module support was not enabled."; + return false; +#else CModule* pModule = FindModule(sModule); sRetMsg = ""; @@ -598,6 +607,7 @@ bool CModules::UnloadModule(const string& sModule, string& sRetMsg) { sRetMsg = "Unable to unload module [" + sModule + "]"; return false; +#endif // !_MODULES } bool CModules::ReloadModule(const string& sModule, const string& sArgs, CUser* pUser, string& sRetMsg) {