From 2d2b012d75755fb9cc10a1cd3d070f83a569242b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 12 Aug 2013 16:27:59 +0200 Subject: sync with Context as of 2013-08-12 --- lualibs-os.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lualibs-os.lua') diff --git a/lualibs-os.lua b/lualibs-os.lua index 3838b55..8bfcf78 100644 --- a/lualibs-os.lua +++ b/lualibs-os.lua @@ -127,7 +127,13 @@ function io.popen (...) ioflush() return iopopen(...) end function os.resultof(command) local handle = io.popen(command,"r") - return handle and handle:read("*all") or "" + if handle then + local result = handle:read("*all") or "" + handle:close() + return result + else + return "" + end end if not io.fileseparator then -- cgit v1.2.3