always close open file handles

Fixes #1619
This commit is contained in:
Benjamin Staneck 2018-01-16 21:58:28 +01:00
parent 5e703796c9
commit a71c6a50ad

14
vendor/clink.lua vendored
View File

@ -210,8 +210,10 @@ end
local function get_git_status() local function get_git_status()
local file = io.popen("git --no-optional-locks status --porcelain 2>nul") local file = io.popen("git --no-optional-locks status --porcelain 2>nul")
for line in file:lines() do for line in file:lines() do
file:close()
return false return false
end end
file:close()
return true return true
end end
@ -221,9 +223,12 @@ end
-- @return {bool} -- @return {bool}
--- ---
local function get_hg_status() local function get_hg_status()
for line in io.popen("hg status -0"):lines() do local file = io.popen("hg status -0")
for line in file:lines() do
file:close()
return false return false
end end
file:close()
return true return true
end end
@ -232,10 +237,13 @@ end
-- Get the status of working dir -- Get the status of working dir
-- @return {bool} -- @return {bool}
--- ---
local function get_svn_status() function get_svn_status()
for line in io.popen("svn status -q"):lines() do local file = io.popen("svn status -q")
for line in file:lines() do
file:close()
return false return false
end end
file:close()
return true return true
end end