From 2e7657aa19a75d699dfd3eb1a65f2bf73fe2dd12 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 19 Jan 2018 19:11:46 -0500 Subject: [PATCH] DosLoadModule("x.dll") wants to find X.DLL in the libpath, like a module name. (I think.) --- lx_loader.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lx_loader.c b/lx_loader.c index dce0711..5544fae 100644 --- a/lx_loader.c +++ b/lx_loader.c @@ -2018,9 +2018,16 @@ static LxModule *loadLxModuleByModuleName(const char *modname) static LxModule *loadLxModuleByPathOrModuleName(const char *modname) { LxModule *retval = NULL; - // !!! FIXME: can a module name be specified as "NAME.DLL" and not be considered a filename? - if (strrchr(modname, '.') == NULL) { - retval = loadLxModuleByModuleName(modname); + if (!strchr(modname, '/') && !strchr(modname, '\\')) { + char *str = (char *) alloca(strlen(modname) + 1); + if (str) { + strcpy(str, modname); + char *ptr = strrchr(str, '.'); + if (ptr) { + *ptr = '\0'; + } + retval = loadLxModuleByModuleName(str); + } // if } else { uint32 err = 0; char *path = makeUnixPath(modname, &err);