diff options
Diffstat (limited to 'src/luarocks/cfg.lua')
-rw-r--r-- | src/luarocks/cfg.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 70c16a2a..ba8c7f22 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -149,11 +149,11 @@ sys_config_file = site_config.LUAROCKS_SYSCONFIG or sys_config_dir.."/config-".. | |||
149 | local err, errcode | 149 | local err, errcode |
150 | sys_config_ok, err, errcode = persist.load_into_table(sys_config_file, cfg) | 150 | sys_config_ok, err, errcode = persist.load_into_table(sys_config_file, cfg) |
151 | 151 | ||
152 | if (not sys_config_ok) and errcode ~= "run" then | 152 | if (not sys_config_ok) and errcode == "open" then -- file not found, so try alternate file |
153 | sys_config_file = sys_config_dir.."/config.lua" | 153 | sys_config_file = sys_config_dir.."/config.lua" |
154 | sys_config_ok, err, errcode = persist.load_into_table(sys_config_file, cfg) | 154 | sys_config_ok, err, errcode = persist.load_into_table(sys_config_file, cfg) |
155 | end | 155 | end |
156 | if (not sys_config_ok) and errcode ~= "open" then | 156 | if (not sys_config_ok) and errcode ~= "open" then -- either "load" or "run"; bad config file, bail out with error |
157 | io.stderr:write(err.."\n") | 157 | io.stderr:write(err.."\n") |
158 | os.exit(cfg.errorcodes.CONFIGFILE) | 158 | os.exit(cfg.errorcodes.CONFIGFILE) |
159 | end | 159 | end |