Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(path): find_upwards() failure case is an infinite loop #506

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shreve
Copy link

@shreve shreve commented Jul 4, 2023

The prior implementation had several implementation issues which caused an infinite loop if the search turned up empty.

This new implementation corrects the bounds check to stop searching once we've searched everywhere we can, and properly searches the root directory.

I'm not sure if this specific change is welcome here, but I also tweaked Path:joinpath to trim tailing separators to prevent double separators when joining on root.

The prior implementation had several implementation issues which caused
an infinite loop if the search turned up empty.

This new implementation corrects the bounds check to stop searching once
we've searched everywhere we can, and properly searches the root
directory
@shreve shreve changed the title Fix Path:find_upwards() fix: Path:find_upwards() Jul 4, 2023
lua/plenary/path.lua Outdated Show resolved Hide resolved
@zapling
Copy link

zapling commented Aug 30, 2023

@Conni2461 do you have any additional input on this? Would love to see this issue resolved.

@shreve shreve changed the title fix: Path:find_upwards() fix(path): find_upwards() failure case is an infinite loop Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants