diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-06-03 13:56:20 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-06-03 18:48:42 -0300 |
commit | a61d362c5a78edfe7a0f6662747934f0a2124603 (patch) | |
tree | 6a3f7adc31f98a48caa8a5865badd6e6f7da74f9 /src | |
parent | b0969db58997eea6b8f1a31a353384727b23a392 (diff) | |
download | luarocks-a61d362c5a78edfe7a0f6662747934f0a2124603.tar.gz luarocks-a61d362c5a78edfe7a0f6662747934f0a2124603.tar.bz2 luarocks-a61d362c5a78edfe7a0f6662747934f0a2124603.zip |
cmd: fix crash if LuaRocks is given a bad LUA_DIR
Includes a regression test.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/cmd.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index cb669226..bbbdcba1 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
@@ -372,6 +372,8 @@ function cmd.run_command(description, commands, external_namespace, ...) | |||
372 | 372 | ||
373 | fs.init() | 373 | fs.init() |
374 | 374 | ||
375 | lua_version = cfg.lua_version | ||
376 | |||
375 | if not lua_found then | 377 | if not lua_found then |
376 | if cfg.variables.LUA_DIR then | 378 | if cfg.variables.LUA_DIR then |
377 | local found = util.find_lua(cfg.variables.LUA_DIR, cfg.lua_version) | 379 | local found = util.find_lua(cfg.variables.LUA_DIR, cfg.lua_version) |