diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-12 16:27:59 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-12 16:27:59 +0200 |
commit | 2d2b012d75755fb9cc10a1cd3d070f83a569242b (patch) | |
tree | 1ba908829be9e845f1eaaa1ba574c5a5fb2fa8ad | |
parent | cf4033d9e77993aede4c94349c87379a65893319 (diff) | |
download | lualibs-2d2b012d75755fb9cc10a1cd3d070f83a569242b.tar.gz |
sync with Context as of 2013-08-12
-rw-r--r-- | lualibs-os.lua | 8 |
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 |