From 2a8b91209627608fe61c21ec96de31b7fffcea94 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 10 Feb 2008 21:31:53 -0500 Subject: Instead of io.popen():read(), a file descriptor is kept and close()'d afterward. --- modules/lua/commands.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/lua/commands.lua') diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua index b5d0c524..2130ff18 100644 --- a/modules/lua/commands.lua +++ b/modules/lua/commands.lua @@ -62,7 +62,9 @@ end function run() local buffer = buffer local cmd = 'lua "'..buffer.filename..'" 2>&1' - local out = io.popen(cmd):read('*all') + local p = io.popen(cmd) + local out = p:read('*all') + p:close() textadept.print('> '..cmd..'\n'..out) end -- cgit v1.2.3