summaryrefslogtreecommitdiff
path: root/src/commands.c
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-08 16:28:50 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-08 16:28:50 +0000
commitc01f8cad22a72bf1a70bf77afe841a6ba60c73fe (patch)
tree0b7754c466e7933f8ffbd5661498c0eb343ad36a /src/commands.c
parentcea53460b02f51c1d91540f4d371262bf8bdfa63 (diff)
Never unset mod_current_module in functions that modules might call, instead save the old values and reset them
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@3000 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/commands.c')
-rw-r--r--src/commands.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/commands.c b/src/commands.c
index cbc99b800..481a74854 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -95,6 +95,8 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
notice_lang(service, u, OPER_DEFCON_DENIED);
}
} else {
+ char *mod_current_module_name_save = mod_current_module_name;
+ Module *mod_current_module_save = mod_current_module;
mod_current_module_name = c->mod_name;
mod_current_module = findModule(c->mod_name);
if ((c->has_priv == NULL) || c->has_priv(u)) {
@@ -106,8 +108,6 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
mod_current_module = findModule(current->mod_name);
if (current->routine)
retVal = current->routine(u);
- mod_current_module_name = NULL;
- mod_current_module = NULL;
current = current->next;
}
}
@@ -116,8 +116,8 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
alog("Access denied for %s with service %s and command %s",
u->nick, service, cmd);
}
- mod_current_module_name = NULL;
- mod_current_module = NULL;
+ mod_current_module_name = mod_current_module_name_save;
+ mod_current_module = mod_current_module_save;
}
} else {
if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u)) {