Fix segfault on exit after opening fb2.zip (#8232)

pull/8261/head
hius07 3 years ago committed by GitHub
parent 3e313be22b
commit 456dfeaf8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,11 +71,13 @@ local CreDocument = Document:new{
function CreDocument:zipContentExt(fname)
local std_out = io.popen("unzip ".."-qql \""..fname.."\"")
if std_out then
local size, ext
for line in std_out:lines() do
local size, ext = string.match(line, "%s+(%d+)%s+.+%.([^.]+)")
-- return the extention
if size and ext then return string.lower(ext) end
size, ext = string.match(line, "%s+(%d+)%s+.+%.([^.]+)")
if size and ext then break end
end
std_out:close()
if ext then return string.lower(ext) end
end
end

Loading…
Cancel
Save