Fix os.outputof for lua 5.3.4

This commit is contained in:
Tom van Dijck 2017-06-13 06:53:13 -07:00
parent 7d503ad511
commit 971f7b58dc

View File

@ -460,17 +460,17 @@
local pipe = io.popen(cmd .. " 2>&1")
local result = pipe:read('*a')
local b, exitcode = pipe:close()
if not b then
exitcode = -1
end
local success, what, code = pipe:close()
if success then
-- chomp trailing newlines
if result then
result = string.gsub(result, "[\r\n]+$", "")
end
return result, exitcode
return result, code, what
else
return nil, code, what
end
end