summaryrefslogtreecommitdiff
path: root/src/entry.rs
diff options
context:
space:
mode:
authorBen Bridle <bridle.benjamin@gmail.com>2024-10-28 19:05:23 +1300
committerBen Bridle <bridle.benjamin@gmail.com>2024-10-28 19:06:24 +1300
commite63ef09d229a41471acfb9d171e4dc91516257db (patch)
treee32123bfea8a1f44915cb5f12cde6e539666cfe0 /src/entry.rs
parent47b25c05a6be51b93c909d38a19440d1c04ba2f8 (diff)
downloadvagabond-e63ef09d229a41471acfb9d171e4dc91516257db.zip
Fix error when opening a path ending with a relative component
This was thought to be impossible, but it was found to trigger when opening the parent directory of a relative path in the form './file'.
Diffstat (limited to 'src/entry.rs')
-rw-r--r--src/entry.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/entry.rs b/src/entry.rs
index 6ea78bc..b59ced5 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -37,8 +37,8 @@ impl Entry {
};
let name = match path.file_name() {
- Some(osstr) => osstr.to_string_lossy().to_string(),
- None => unreachable!(),
+ Some(os_str) => os_str.to_string_lossy().to_string(),
+ None => path.to_string_lossy().to_string(),
};
let extension = match path.extension() {
Some(extension) => extension.to_string_lossy().into(),