From cae0be3af69f32eee05028ca2ee0c4b6997171af Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 25 Jan 2015 19:20:08 +0100 Subject: 34387: Avoid loading the main zsh binary as a module --- Src/module.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Src') 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; -- cgit 1.4.1