From a8fe9e376ee4517486513b47e7be143311c96e06 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Sun, 8 May 2016 13:58:01 +0300 Subject: Fix some luacheck warnings in install.bat --- install.bat | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/install.bat b/install.bat index 053fdfd6..df058585 100644 --- a/install.bat +++ b/install.bat @@ -55,7 +55,7 @@ local function die(message) os.exit(1) end -function split_string(str, delim, maxNb) +local function split_string(str, delim, maxNb) -- Eliminate bad cases... if string.find(str, delim) == nil then return { str } @@ -543,8 +543,7 @@ local function look_for_lua_install () else -- no prefix given, so use path directories = (os.getenv("PATH",";") or "") - local i = 1 - while i ~= 0 do directories, i = directories:gsub(";;",";") end --remove all doubles + directories = directories:gsub(";+", ";") --remove all doubles directories = split_string(directories,";") -- if a path element ends with "\bin\" then remove it, as the searcher will check there anyway for i, val in ipairs(directories) do @@ -651,7 +650,7 @@ local with_arg = { -- options followed by an argument, others are flags -- this will be damaged by the batch construction at the start of this file local oarg = arg -- retain old table if #arg > 0 then - farg = table.concat(arg, " ") .. " " + local farg = table.concat(arg, " ") .. " " arg = {} farg = farg:gsub('%"', "") local i = 0 @@ -672,7 +671,6 @@ if #arg > 0 then end end for k,v in pairs(oarg) do if k < 1 then arg[k] = v end end -- copy 0 and negative indexes -oarg = nil -- build config option table with name and value elements local i = 1 @@ -771,7 +769,6 @@ if not vars.TREE_ROOT then end end -local datapath vars.SYSCONFDIR = vars.SYSCONFDIR or vars.PREFIX vars.SYSCONFFILENAME = S"config-$LUA_VERSION.lua" vars.CONFIG_FILE = vars.SYSCONFDIR.."\\"..vars.SYSCONFFILENAME -- cgit v1.2.3-55-g6feb