Skip to content

Commit 4f71c0c

Browse files
authored
fix(path): Windows parent root directory (#504)
1 parent 6632469 commit 4f71c0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/plenary/path.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,11 @@ end
696696
local _get_parent = (function()
697697
local formatted = string.format("^(.+)%s[^%s]+", path.sep, path.sep)
698698
return function(abs_path)
699-
return abs_path:match(formatted)
699+
local parent = abs_path:match(formatted)
700+
if parent ~= nil and not parent:find(path.sep) then
701+
return parent .. path.sep
702+
end
703+
return parent
700704
end
701705
end)()
702706

0 commit comments

Comments
 (0)