summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-09-08 18:02:49 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-09-08 18:02:49 +0000
commit477e1615afea4cdf3aa5c7ebf467edf35afc5980 (patch)
treed92237dd1a1e4b45942666a1ebd6c117d505371a /src/core
parentb4512842e5c9d1c13f33dadbf9977e937d330fef (diff)
downloadirssi-477e1615afea4cdf3aa5c7ebf467edf35afc5980.zip
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
Diffstat (limited to 'src/core')
-rw-r--r--src/core/modules-load.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/core/modules-load.c b/src/core/modules-load.c
index c6e86351..ddaad721 100644
--- a/src/core/modules-load.c
+++ b/src/core/modules-load.c
@@ -212,14 +212,18 @@ static int module_load_prefixes(const char *path, const char *module,
int start, int end, char **prefixes)
{
GString *realpath;
- int status;
+ int status, ok;
/* load module_core */
realpath = g_string_new(path);
g_string_insert(realpath, end, "_core");
- status = module_load_name(realpath->str, module, "core", FALSE);
- if (status > 0 && prefixes != NULL) {
+ /* Don't print the error message the first time, since the module
+ 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,
etc. part of the module */
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(realpath, start, *prefixes);
- module_load_name(realpath->str, module,
- *prefixes, TRUE);
+ status = module_load_name(realpath->str, module,
+ *prefixes, TRUE);
+ if (status > 0)
+ ok = TRUE;
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);
- return status;
+ return ok;
}
static int module_load_full(const char *path, const char *rootmodule,