summaryrefslogtreecommitdiff
path: root/lualibs-os.lua
diff options
context:
space:
mode:
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