summaryrefslogtreecommitdiff
path: root/lualibs-os.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-08-12 16:27:59 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-08-12 16:27:59 +0200
commit2d2b012d75755fb9cc10a1cd3d070f83a569242b (patch)
tree1ba908829be9e845f1eaaa1ba574c5a5fb2fa8ad /lualibs-os.lua
parentcf4033d9e77993aede4c94349c87379a65893319 (diff)
downloadlualibs-2d2b012d75755fb9cc10a1cd3d070f83a569242b.tar.gz
sync with Context as of 2013-08-12
Diffstat (limited to 'lualibs-os.lua')
-rw-r--r--lualibs-os.lua8
1 files changed, 7 insertions, 1 deletions
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