mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
Loading modules that didn't have "core" part didn't work (eg. irc_proxy).
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1778 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
b4512842e5
commit
477e1615af
@ -212,14 +212,18 @@ static int module_load_prefixes(const char *path, const char *module,
|
|||||||
int start, int end, char **prefixes)
|
int start, int end, char **prefixes)
|
||||||
{
|
{
|
||||||
GString *realpath;
|
GString *realpath;
|
||||||
int status;
|
int status, ok;
|
||||||
|
|
||||||
/* load module_core */
|
/* load module_core */
|
||||||
realpath = g_string_new(path);
|
realpath = g_string_new(path);
|
||||||
g_string_insert(realpath, end, "_core");
|
g_string_insert(realpath, end, "_core");
|
||||||
|
|
||||||
status = module_load_name(realpath->str, module, "core", FALSE);
|
/* Don't print the error message the first time, since the module
|
||||||
if (status > 0 && prefixes != NULL) {
|
may not have the core part at all. */
|
||||||
|
status = module_load_name(realpath->str, module, "core", TRUE);
|
||||||
|
ok = status > 0;
|
||||||
|
|
||||||
|
if (prefixes != NULL) {
|
||||||
/* load all the "prefix modules", like the fe-common, irc,
|
/* load all the "prefix modules", like the fe-common, irc,
|
||||||
etc. part of the module */
|
etc. part of the module */
|
||||||
while (*prefixes != NULL) {
|
while (*prefixes != NULL) {
|
||||||
@ -227,15 +231,24 @@ static int module_load_prefixes(const char *path, const char *module,
|
|||||||
g_string_insert_c(realpath, start, '_');
|
g_string_insert_c(realpath, start, '_');
|
||||||
g_string_insert(realpath, start, *prefixes);
|
g_string_insert(realpath, start, *prefixes);
|
||||||
|
|
||||||
module_load_name(realpath->str, module,
|
status = module_load_name(realpath->str, module,
|
||||||
*prefixes, TRUE);
|
*prefixes, TRUE);
|
||||||
|
if (status > 0)
|
||||||
|
ok = TRUE;
|
||||||
|
|
||||||
prefixes++;
|
prefixes++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ok) {
|
||||||
|
/* error loading module, print the error message */
|
||||||
|
g_string_assign(realpath, path);
|
||||||
|
g_string_insert(realpath, end, "_core");
|
||||||
|
module_load_name(realpath->str, module, "core", FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
g_string_free(realpath, TRUE);
|
g_string_free(realpath, TRUE);
|
||||||
return status;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int module_load_full(const char *path, const char *rootmodule,
|
static int module_load_full(const char *path, const char *rootmodule,
|
||||||
|
Loading…
Reference in New Issue
Block a user