diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-27 14:13:17 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-27 14:15:39 -0300 |
| commit | 4b6d33f063ddc5785572ff6b0696166c06ead02c (patch) | |
| tree | c47f510c0b0144b5c062f8f7fe59e0b81882070d /src | |
| parent | 03e401231972d7b4db0145a71ce74d5d18d1a901 (diff) | |
| download | luarocks-4b6d33f063ddc5785572ff6b0696166c06ead02c.tar.gz luarocks-4b6d33f063ddc5785572ff6b0696166c06ead02c.tar.bz2 luarocks-4b6d33f063ddc5785572ff6b0696166c06ead02c.zip | |
fix: more resilient sysconfdir detection
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/core/cfg.lua | 6 |
1 files changed, 5 insertions, 1 deletions
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() | |||
| 54 | if not debug then | 54 | if not debug then |
| 55 | return | 55 | return |
| 56 | end | 56 | end |
| 57 | local src = dir.normalize(debug.getinfo(1, "S")) | 57 | local src = debug.getinfo(1, "S").source |
| 58 | if not src then | ||
| 59 | return | ||
| 60 | end | ||
| 61 | src = dir.normalize(src) | ||
| 58 | if src:sub(1, 1) == "@" then | 62 | if src:sub(1, 1) == "@" then |
| 59 | src = src:sub(2) | 63 | src = src:sub(2) |
| 60 | end | 64 | end |
