Skip to content

Commit 0fc8c47

Browse files
committed
Added extension parsing to unzip.
1 parent 40ec345 commit 0fc8c47

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

arch/UNZIP.LUA

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ function unzip(z, d, l, x)
3737
-- v = System path seperator/Version needed
3838
-- f = File
3939
local C, v, f = 4096, package.config:sub(1, 1)
40-
f, E = io.open(z, "rb") D()
40+
f = io.open(z, "rb")
41+
if not f then f, E = io.open(z .. ".zip", "rb") D() end
4142
if not d then d = "." end
4243
if d:sub(-1) ~= v then d = d .. v end
4344

@@ -144,7 +145,7 @@ end
144145

145146
if arg[-1] then
146147
if #arg < 1 then
147-
print(arg[-1] .. " " .. (arg[0] or "?") .. "file[.zip] [list] [-x xlist] [-d exdir]")
148+
print(arg[-1] .. " " .. (arg[0] or "?") .. " file[.zip] [list] [-x xlist] [-d exdir]")
148149
os.exit(1)
149150
end
150151

0 commit comments

Comments
 (0)