summaryrefslogtreecommitdiff
path: root/xmake/core/base/path.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-18 22:48:54 +0800
committerruki <[email protected]>2020-03-18 10:53:29 +0800
commitdd941c7ecac8c9d500660ed7ffc1af36b2ba54b6 (patch)
tree781c9c96e654b1d76a6fc1cedffb6bcb191093d2 /xmake/core/base/path.lua
parent5c3a3168f645495cc5d2ab3472d1e3d366bbb004 (diff)
rename string.find_last to lastof
Diffstat (limited to 'xmake/core/base/path.lua')
-rw-r--r--xmake/core/base/path.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua
index dd07badf6..b941d1085 100644
--- a/xmake/core/base/path.lua
+++ b/xmake/core/base/path.lua
@@ -27,7 +27,7 @@ local string = require("base/string")
-- get the directory of the path
function path.directory(p)
assert(p)
- local i = p:find_last("[/\\]")
+ local i = p:lastof("[/\\]")
if i then
if i > 1 then i = i - 1 end
return p:sub(1, i)
@@ -39,7 +39,7 @@ end
-- get the filename of the path
function path.filename(p)
assert(p)
- local i = p:find_last("[/\\]")
+ local i = p:lastof("[/\\]")
if i then
return p:sub(i + 1)
else
@@ -51,7 +51,7 @@ end
function path.basename(p)
assert(p)
local name = path.filename(p)
- local i = name:find_last(".", true)
+ local i = name:lastof(".", true)
if i then
return name:sub(1, i - 1)
else
@@ -62,7 +62,7 @@ end
-- get the file extension of the path: .xxx
function path.extension(p)
assert(p)
- local i = p:find_last(".", true)
+ local i = p:lastof(".", true)
if i then
return p:sub(i)
else