Skip to content

Commit

Permalink
fix: corrected Path:find_upwards (#641)
Browse files Browse the repository at this point in the history
now calls Path:root properly, and
return nil at the end of execution instead of emptystring
  • Loading branch information
StefanZuefeldt authored Feb 11, 2025
1 parent 28c9cdd commit d5d8561
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/plenary/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ end

function Path:find_upwards(filename)
local folder = Path:new(self)
local root = path.root(folder)
local root = path.root(folder:absolute())

while folder:absolute() ~= root do
local p = folder:joinpath(filename)
Expand All @@ -938,7 +938,7 @@ function Path:find_upwards(filename)
end
folder = folder:parent()
end
return ""
return nil
end

return Path

0 comments on commit d5d8561

Please sign in to comment.