From e5e47e0aaaed07db9bbeabd9edb8fb2600759ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAURENS=20J=C3=A9r=C3=B4me?= Date: Tue, 16 Jul 2024 15:59:49 +0200 Subject: [PATCH] chore(path): validate path if given in abspath (#485) --- lua/pl/path.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pl/path.lua b/lua/pl/path.lua index e019a068..011b9794 100644 --- a/lua/pl/path.lua +++ b/lua/pl/path.lua @@ -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()