diff options
-rw-r--r-- | src/modules.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules.c b/src/modules.c index 227fc21..a2a19b3 100644 --- a/src/modules.c +++ b/src/modules.c @@ -383,30 +383,30 @@ load_core_modules(int warn) * side effects - module is loaded if found. */ int -load_one_module(const char *path) +load_one_module(const char *name) { dlink_node *ptr = NULL; - char modpath[HYB_PATH_MAX + 1]; + char path[HYB_PATH_MAX + 1]; struct stat statbuf; DLINK_FOREACH(ptr, modules_path.head) { const struct module_path *mpath = ptr->data; - snprintf(modpath, sizeof(modpath), "%s/%s", mpath->path, path); + snprintf(path, sizeof(path), "%s/%s", mpath->path, name); - if (!modules_valid_suffix(path)) + if (!modules_valid_suffix(name)) continue; - if (strstr(modpath, "../") == NULL && - strstr(modpath, "/..") == NULL) - if (!stat(modpath, &statbuf)) + if (strstr(path, "../") == NULL && + strstr(path, "/..") == NULL) + if (!stat(path, &statbuf)) if (S_ISREG(statbuf.st_mode)) /* Regular files only please */ - return load_a_module(modpath, 1); + return load_a_module(path, 1); } sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "Cannot locate module %s", path); - ilog(LOG_TYPE_IRCD, "Cannot locate module %s", path); + "Cannot locate module %s", name); + ilog(LOG_TYPE_IRCD, "Cannot locate module %s", name); return -1; } |