From 49b88868dff6ca5d162569641cb6e18cd089028e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 12 Oct 2024 06:52:44 +0200 Subject: [PATCH] Fix stripping of " (deleted)" from non-UTF8 paths to fish --- src/common.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common.rs b/src/common.rs index b2a7834ba..8e6906648 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1669,8 +1669,7 @@ pub fn get_executable_path(argv0: impl AsRef) -> PathBuf { // When /proc/self/exe points to a file that was deleted (or overwritten on update!) // then linux adds a " (deleted)" suffix. // If that's not a valid path, let's remove that awkward suffix. - let pathstr = path.to_str().unwrap_or(""); - if !pathstr.ends_with(" (deleted)") { + if !path.ends_with(" (deleted)") { return path; }