diff options
Diffstat (limited to 'xmake/core/base/path.lua')
| -rw-r--r-- | xmake/core/base/path.lua | 8 |
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 |
