diff options
author | 2008-06-25 23:32:05 -0400 | |
---|---|---|
committer | 2008-06-25 23:32:05 -0400 | |
commit | b2f088f8d8eb00eed8d928a0949d4c32532ef445 (patch) | |
tree | 299db1be4c8c2aeda7876986f4d5c8220b85d688 /core/init.lua | |
parent | 32eff723437321048d2833b6b2e1a8a7dd720abb (diff) | |
download | textadept-b2f088f8d8eb00eed8d928a0949d4c32532ef445.tar.gz textadept-b2f088f8d8eb00eed8d928a0949d4c32532ef445.zip |
Treat lua_dialog.lua as a program, not module; core/init.lua
I discovered it was possible to get gtk.so to segfault with repeated
textdept.reset() commands and then invoke lua_dialog.
Diffstat (limited to 'core/init.lua')
-rw-r--r-- | core/init.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/init.lua b/core/init.lua index 3acd3875..3869adf9 100644 --- a/core/init.lua +++ b/core/init.lua @@ -6,7 +6,6 @@ package.cpath = _HOME..'/core/?.so;'..package.cpath require 'iface' require 'events' require 'file_io' -require 'lua_dialog' --- -- Checks if the buffer being indexed is the currently focused buffer. @@ -31,10 +30,13 @@ end -- used. -- @return string CocoaDialog result. function cocoa_dialog(kind, opts) - local args = { kind } + local args = '' for k, v in pairs(opts) do - args[#args + 1] = '--'..k - if type(v) == 'string' then args[#args + 1] = v end + args = args..' --'..k + if type(v) == 'string' then args = args..' "'..v..'"' end end - return lua_dialog.run(args) + local p = io.popen(_HOME..'/core/lua_dialog.lua '..kind..args) + local out = p:read('*all') + p:close() + return out end |