bnjbvr / cargo-machete

Remove unused Rust dependencies with this one weird trick!
MIT License
784 stars 28 forks source link

Prevent Cargo.toml search from going on longer than it should #84

Closed tgnottingham closed 1 year ago

tgnottingham commented 1 year ago

The Cargo.toml search approach that looks at all ancestor directories goes on longer than it should. The problem is that it constructs paths like "/example/../../../../..", but that path is considered to exist, so the loop would continue on until the path was too long to be valid.

Noticed this while running machete under strace to see what paths it was looking at, in order to diagnose a false positive.