From 4b6d33f063ddc5785572ff6b0696166c06ead02c Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 27 Feb 2024 14:13:17 -0300 Subject: fix: more resilient sysconfdir detection --- src/luarocks/core/cfg.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index 90e52150..6d8fe55b 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -54,7 +54,11 @@ local function detect_sysconfdir() if not debug then return end - local src = dir.normalize(debug.getinfo(1, "S")) + local src = debug.getinfo(1, "S").source + if not src then + return + end + src = dir.normalize(src) if src:sub(1, 1) == "@" then src = src:sub(2) end -- cgit v1.2.3-55-g6feb