mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
Unbreak hack to strip " (deleted)" suffix from executable path
Commit 49b88868df (Fix stripping of " (deleted)" from non-UTF8 paths
to fish, 2024-10-12) was wrong because Path::ends_with() considers
entire path components. Fix that.
Refs:
- https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$k2IQazfmztFUXrairmIQvx_seS1ZJ7HlFWhmNy479Dg
- https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$4pugfHejL9J9L89zuFU6Bfg41UMjA0y79orc3EaBego
This commit is contained in:
@@ -1654,7 +1654,7 @@ pub fn get_executable_path(argv0: impl AsRef<Path>) -> PathBuf {
|
|||||||
// When /proc/self/exe points to a file that was deleted (or overwritten on update!)
|
// When /proc/self/exe points to a file that was deleted (or overwritten on update!)
|
||||||
// then linux adds a " (deleted)" suffix.
|
// then linux adds a " (deleted)" suffix.
|
||||||
// If that's not a valid path, let's remove that awkward suffix.
|
// If that's not a valid path, let's remove that awkward suffix.
|
||||||
if !path.ends_with(" (deleted)") {
|
if path.as_os_str().as_bytes().ends_with(b" (deleted)") {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user