Fix removal of DCC_PROC-type plugin addins

The declaration of dcc_dllcommands in modules.c was wrong - add it to dcc.h so it's checked against the definition in dcc.c
and include it from there.

The DCC_dllcommands structure isn't structured like a "List2" so remove_module() doesn't work - use remove_from_list_ext().
This commit is contained in:
Kevin Easton
2017-04-15 22:50:24 +10:00
parent eca1e54602
commit a01a93eaa3
2 changed files with 10 additions and 2 deletions

View File

@@ -43,7 +43,6 @@ CVS_REVISION(modules_c)
IrcVariableDll *dll_variable = NULL;
extern void *default_output_function;
extern DCC_dllcommands dcc_dllcommands;
extern void *default_status_output_function;
Function_ptr global_table[NUMBER_OF_GLOBAL_FUNCTIONS] = { NULL };
@@ -1158,6 +1157,11 @@ register List2 *tmp;
return NULL;
}
static int cmp_dcc_dllcmd_module(List *node, char *name)
{
const DCC_dllcommands *dllcmd = (DCC_dllcommands *)node;
return strcasecmp(dllcmd->module, name);
}
int BX_remove_module_proc(unsigned int mod_type, char *modname, char *procname, char *desc)
{
@@ -1274,7 +1278,7 @@ int count = 0;
case DCC_PROC:
{
DCC_dllcommands *ptr;
while ((ptr = (DCC_dllcommands *)remove_module((List2 **)&dcc_dllcommands, modname)))
while ((ptr = (DCC_dllcommands *)remove_from_list_ext((List **)&dcc_dllcommands, modname, cmp_dcc_dllcmd_module)))
{
new_free(&ptr->name);
new_free(&ptr->module);