summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-16 09:47:39 +0800
committerGitHub <[email protected]>2021-12-16 09:47:39 +0800
commitc6ece064664fce0623c000227de67dc33b16d302 (patch)
tree1922bf7991c96439cff5f6eccdf1330a18cf3f98
parenta0d7ded27f92784884e804f330231ec7a3e33b52 (diff)
Update extension.lua
-rw-r--r--xmake/modules/utils/archive/extension.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/utils/archive/extension.lua b/xmake/modules/utils/archive/extension.lua
index ae8b97153..ca4c8abd8 100644
--- a/xmake/modules/utils/archive/extension.lua
+++ b/xmake/modules/utils/archive/extension.lua
@@ -23,15 +23,15 @@ import("core.base.hashset")
-- get the archive extension
function main(archivefile)
-
local extension = ""
local filename = path.filename(archivefile)
local extensionset = hashset.from({".zip", ".7z", ".gz", ".xz", ".tgz", ".bz2", ".tar", ".tar.gz", ".tar.xz", ".tar.bz2", ".tar.lz"})
local i = filename:lastof(".", true)
if i then
local p = filename:sub(1, i - 1):lastof(".", true)
- if p and extensionset:has(filename:sub(p)) then i = p end
- extension = filename:sub(i)
+ if p and extensionset:has(filename:sub(p)) then
+ extension = filename:sub(p)
+ end
end
return extension
end