Skip to content

Commit b05ee67

Browse files
authored
fix(path): make find_upwards stop at root (#562)
1 parent a398c5f commit b05ee67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/plenary/path.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,9 @@ end
929929

930930
function Path:find_upwards(filename)
931931
local folder = Path:new(self)
932-
while self:absolute() ~= path.root do
932+
local root = path.root(folder)
933+
934+
while folder:absolute() ~= root do
933935
local p = folder:joinpath(filename)
934936
if p:exists() then
935937
return p

0 commit comments

Comments
 (0)