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 Panic when Name can't be determined and check the filesystem to determine directory #952

Merged
merged 6 commits into from
Jan 27, 2024

Conversation

coreyja
Copy link
Owner

@coreyja coreyja commented Jan 27, 2024

This fixes some bugs reported by @petobens, thanks so much for the reports!

The first is a panic when the last bit of the path as .., because it used Path::file_name and paniced on .., which is documented to return None.
https://doc.rust-lang.org/std/path/struct.Path.html#method.file_name
Now we return a None as well, and when we need to render the filename we use the input string instead so we should see .. un-modified in that case

The second fix is to better identify directories. Now instead of just checking for a trailing slash, we ask the file system as a fallback. This supports both local and absolute paths

@coreyja coreyja changed the title Fix Panic when Name can't be determined Fix Panic when Name can't be determined and check the filesystem to determine directory Jan 27, 2024
@coreyja coreyja marked this pull request as ready for review January 27, 2024 21:10
@coreyja coreyja force-pushed the ca/main/name-unwrap branch from 8d5315d to 7e37fb8 Compare January 27, 2024 21:24
@coreyja coreyja merged commit fd35459 into main Jan 27, 2024
7 checks passed
@coreyja coreyja deleted the ca/main/name-unwrap branch January 27, 2024 22:02
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.

1 participant