From 5f069526966ae37319ba745644a43e0cf64ad62c Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Tue, 5 Jul 2016 15:24:01 +0300 Subject: Fix field name building in type_check.lua Use 'parent[field]' notation for non-string fields. --- src/luarocks/type_check.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua index 82763401..63c59ca2 100644 --- a/src/luarocks/type_check.lua +++ b/src/luarocks/type_check.lua @@ -234,9 +234,12 @@ end local function mkfield(context, field) if context == "" then - return field + return tostring(field) + elseif type(field) == "string" then + return context.."."..field + else + return context.."["..tostring(field).."]" end - return context.."."..field end --- Type check the contents of a table. -- cgit v1.2.3-55-g6feb From b5b285a678fe78b80d452cc9eb7565b8bf087b81 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Tue, 5 Jul 2016 15:46:43 +0300 Subject: Fix implicit number-to-string coversion in luarocks.help --- src/luarocks/help.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/luarocks/help.lua b/src/luarocks/help.lua index 28f97702..871e97e9 100644 --- a/src/luarocks/help.lua +++ b/src/luarocks/help.lua @@ -65,7 +65,7 @@ function help.command(flags, command) --verbose Display verbose output of commands executed. --timeout= Timeout on network operations, in seconds. 0 means no timeout (wait forever). - Default is ]]..cfg.connection_timeout..[[.]]) + Default is ]]..tostring(cfg.connection_timeout)..[[.]]) print_section("VARIABLES") util.printout([[ Variables from the "variables" table of the configuration file -- cgit v1.2.3-55-g6feb