Skip to content

Commit d5d8561

Browse files
fix: corrected Path:find_upwards (#641)
now calls Path:root properly, and return nil at the end of execution instead of emptystring
1 parent 28c9cdd commit d5d8561

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/plenary/path.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ end
929929

930930
function Path:find_upwards(filename)
931931
local folder = Path:new(self)
932-
local root = path.root(folder)
932+
local root = path.root(folder:absolute())
933933

934934
while folder:absolute() ~= root do
935935
local p = folder:joinpath(filename)
@@ -938,7 +938,7 @@ function Path:find_upwards(filename)
938938
end
939939
folder = folder:parent()
940940
end
941-
return ""
941+
return nil
942942
end
943943

944944
return Path

0 commit comments

Comments
 (0)