summaryrefslogtreecommitdiff
path: root/xmake/core/base/path.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-01-25 00:24:28 +0800
committerruki <[email protected]>2022-01-24 20:31:42 +0800
commita1ecc4de70ff0e108bcf89fbccfd25189239071c (patch)
tree08427c2894ba9c7fc11eabdb3f961b31b55e3cf6 /xmake/core/base/path.lua
parent335c29ab1f40b8db81dce90388d846bdb0682e10 (diff)
fix path
Diffstat (limited to 'xmake/core/base/path.lua')
-rw-r--r--xmake/core/base/path.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua
index 18dbc6b01..92b926705 100644
--- a/xmake/core/base/path.lua
+++ b/xmake/core/base/path.lua
@@ -72,10 +72,14 @@ end
function path.extension(p, level)
local i = p:lastof(".", true)
if i then
+ local ext = p:sub(i)
+ if ext:find("[/\\]") then
+ return ""
+ end
if level and level > 1 then
- return path.extension(p:sub(1, i - 1), level - 1) .. p:sub(i)
+ return path.extension(p:sub(1, i - 1), level - 1) .. ext
end
- return p:sub(i)
+ return ext
else
return ""
end