Update install/data/tarbad

This commit is contained in:
2026-03-12 11:56:58 -04:00
parent 5e3cdbe40c
commit 08323e00ff

View File

@@ -98,16 +98,16 @@ local function unpack_tar(tarstr)
local pad = (512 - (size % 512)) % 512 local pad = (512 - (size % 512)) % 512
i = i + size + pad i = i + size + pad
if name == "" then goto continue end if name ~= "" then
local is_dir = typeflag == "5" or name:sub(-1) == "/"
local is_dir = typeflag == "5" or name:sub(-1) == "/
local clean_name = name:gsub("/$", "") local clean_name = name:gsub("/$", "")
if clean_name == "" then goto continue end
if clean_name ~= "" then
local parent_path = clean_name:match("(.+)/") local parent_path = clean_name:match("(.+)/")
local fname = clean_name:match("([^/]+)$") local fname = clean_name:match("([^/]+)$")
if not fname then goto continue end if not fname then
local parent = root local parent = root
if parent_path then if parent_path then
@@ -119,8 +119,9 @@ local function unpack_tar(tarstr)
else else
parent[fname] = { __type = "file", __contents = contents } parent[fname] = { __type = "file", __contents = contents }
end end
end
::continue:: end
end
end end
return flatten(root) return flatten(root)