diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2023-08-13 18:55:34 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2023-08-13 18:55:34 +0200 |
commit | cf5b93b1590ee707ee3d14eda1f9368aa404b689 (patch) | |
tree | 8da42eae75d6140327d13de97a7073ef67eabebd | |
parent | 9688caed346cdde5a5546f9a6c722eccf3b7ede1 (diff) | |
download | vis-open_rej-cf5b93b1590ee707ee3d14eda1f9368aa404b689.tar.gz |
Unfortunately Lua 5.3 (on Leap 15) doesn’t to-be-closed variables yet.
-rw-r--r-- | init.lua | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,8 @@ local function file_exists(path) - local f <close> = io.open(path) + local f = io.open(path) + if f ~= nil then + debug.getmetatable(f)["__gc"] = io.close + end return f ~= nil end |