From 800c2fe268481d6dc60f95005032a72d8cbe82db Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 18 Apr 2013 14:47:32 -0300 Subject: Fix uses of home_config_file when it goes missing due to --force-config. --- src/luarocks/cfg.lua | 2 +- src/luarocks/help.lua | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 2f2c7a66..90bed195 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -264,7 +264,7 @@ local defaults = { } if detected.windows then - home_config_file = home_config_file:gsub("\\","/") + home_config_file = home_config_file and home_config_file:gsub("\\","/") defaults.fs_use_modules = false defaults.arch = "win32-"..proc defaults.platforms = {"win32", "windows" } diff --git a/src/luarocks/help.lua b/src/luarocks/help.lua index 45fc3bb4..2944dfd8 100644 --- a/src/luarocks/help.lua +++ b/src/luarocks/help.lua @@ -80,9 +80,12 @@ function run(...) util.printout("\t", command.help_summary) end print_section("CONFIGURATION") - util.printout([[ - System configuration file: ]]..sys_file .. " (" .. get_status(sys_ok) ..[[) - User configuration file: ]]..home_file .. " (" .. get_status(home_ok) ..")\n") + util.printout("\tSystem configuration file: ".. sys_file .. " (" .. get_status(sys_ok) ..")") + if home_file then + util.printout("\tUser configuration file: ".. home_file .. " (" .. get_status(home_ok) ..")\n") + else + util.printout("\tUser configuration file disabled in this LuaRocks installation.\n") + end else command = command:gsub("-", "_") if commands[command] then -- cgit v1.2.3-55-g6feb