From 7eb72bd15c9c6ddbfcc3f777aed9f611c7ce0973 Mon Sep 17 00:00:00 2001 From: Daniel Lang Date: Tue, 12 Mar 2024 22:43:43 +0100 Subject: [PATCH] fix: bugfix to resolve absolute paths that are not symlinks --- src/fs/file.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fs/file.rs b/src/fs/file.rs index efac1f93..ca0be62b 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -344,7 +344,7 @@ impl<'dir> File<'dir> { pub fn absolute_path(&self) -> Option<&PathBuf> { self.absolute_path .get_or_init(|| { - if self.link_target().is_broken() { + if self.is_link() && self.link_target().is_broken() { // workaround for broken symlinks to get absolute path for parent and then // append name of file; std::fs::canonicalize requires all path components // (including the last one) to exist