Skip to content

Commit

Permalink
guard in path.abspath
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaurens committed Jul 15, 2024
1 parent f3d8e99 commit 7cc7105
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 7cc7105

Please sign in to comment.