Skip to content

Commit

Permalink
chore(path): validate path if given in abspath (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaurens authored Jul 16, 2024
1 parent 375d5c5 commit e5e47e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/pl/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ end
-- @string[opt] pwd optional start path to use (default is current dir)
function path.abspath(P,pwd)
assert_string(1,P)
if pwd then assert_string(2,pwd) end
local use_pwd = pwd ~= nil
if use_pwd then assert_string(2,pwd) end
if not use_pwd and not currentdir() then return P end
P = P:gsub('[\\/]$','')
pwd = pwd or currentdir()
Expand Down

0 comments on commit e5e47e0

Please sign in to comment.