Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close file handles in clink.lua #2083

Merged
merged 1 commit into from
May 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions vendor/clink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,15 @@ end
-- @return {false|mercurial branch name}
---
local function get_hg_branch()
for line in io.popen("hg branch 2>nul"):lines() do
local file = io.popen("hg branch 2>nul")
for line in file:lines() do
local m = line:match("(.+)$")
if m then
file:close()
return m
end
end
file:close()

return false
end
Expand All @@ -204,12 +207,15 @@ end
-- @return {false|svn branch name}
---
local function get_svn_branch(svn_dir)
for line in io.popen("svn info 2>nul"):lines() do
local file = io.popen("svn info 2>nul")
for line in file:lines() do
local m = line:match("^Relative URL:")
if m then
file:close()
return line:sub(line:find("/")+1,line:len())
end
end
file:close()

return false
end
Expand Down