1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-05 23:33:12 +02:00

Made it so "modulename.so" -> "./modulename.so"`

This commit is contained in:
griever
2001-12-27 05:59:05 +00:00
parent c07e8962e5
commit 3594f2ee45
2 changed files with 17 additions and 3 deletions
+2
View File
@@ -1038,3 +1038,5 @@ seen. gmtime warning still there
found by HA|Raptor
- If host == null, don't set it (m_oper, was setting it to "eek.host.is.null.pointer")
- Small fix for #427583 mode bug
- Fixed it so /module load doesnt require you to do ./module.so if the module is in
current dir
+15 -3
View File
@@ -83,7 +83,7 @@ Module *Module_Find(char *name)
/*
* Returns an error if insucessful .. yes NULL is OK!
*/
char *Module_Load (char *path, int load)
char *Module_Load (char *path_, int load)
{
#ifndef STATIC_LINKING
#ifdef _WIN32
@@ -95,11 +95,21 @@ char *Module_Load (char *path, int load)
int (*Mod_Load)();
int (*Mod_Unload)();
static char errorbuf[1024];
char *path;
ModuleHeader *mod_header;
int ret = 0;
Module *mod = NULL;
Debug((DEBUG_DEBUG, "Attempting to load module from %s",
path));
path_));
path = path_;
if(!strchr(path, '/'))
{
path = malloc(strlen(path) + 3);
strcpy(path, "./");
strcat(path, path_);
}
if ((Mod = irc_dlopen(path, RTLD_NOW)))
{
/* We have engaged the borg cube. Scan for lifesigns. */
@@ -193,7 +203,9 @@ char *Module_Load (char *path, int load)
/* Return the error .. */
return ((char *)irc_dlerror());
}
if (path != path_)
free(path);
#else /* !STATIC_LINKING */
return "We don't support dynamic linking";