about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/module.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/module.c b/Src/module.c
index 97a4869cd..7dd47016c 100644
--- a/Src/module.c
+++ b/Src/module.c
@@ -1577,7 +1577,9 @@ try_load_module(char const *name)
 	if (l + (**pp ? strlen(*pp) : 1) > PATH_MAX)
 	    continue;
 	sprintf(buf, "%s/%s.%s", **pp ? *pp : ".", name, DL_EXT);
-	ret = dlopen(unmeta(buf), RTLD_LAZY | RTLD_GLOBAL);
+	unmetafy(buf, NULL);
+	if (*buf) /* dlopen(NULL) returns a handle to the main binary */
+	    ret = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL);
     }
 
     return ret;