Commit: 63279ba2f3bdfd3ebeb8e0df32e1ac1afe5265f7
Parent: afc93684d71ac781657c87161528edeac1a415a1
Author: Ren Tatsumoto
Date: Sun, 18 Oct 2020 10:18:24 +0300
avoid crashes on systems using lua 5.1
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -173,7 +173,9 @@ local copy_to_clipboard = (function()
if is_empty(text) then
return
end
- assert(io.open(clip_filepath, "w")):write(text):close()
+ local handle = assert(io.open(clip_filepath, "w"))
+ handle:write(text)
+ handle:close()
mp.commandv("run", "xclip", "-selection", "clipboard", clip_filepath)
end
end)()
@@ -329,7 +331,7 @@ end
local function join_media_fields(note1, note2)
if note2 == nil then
- goto ret
+ return note1
end
if note2[config.audio_field] then
@@ -340,7 +342,6 @@ local function join_media_fields(note1, note2)
note1[config.image_field] = note2[config.image_field] .. note1[config.image_field]
end
- :: ret ::
return note1
end