From 008764a2cdf3ea016f26f22575869b8909d90eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=B8rl=C3=BCck=20Berg?= <36937807+henrikhorluck@users.noreply.github.com> Date: Sun, 20 Aug 2023 17:56:47 +0200 Subject: [PATCH] Make DEFAULT_PATH allow overriding system binaries This is in regards to a comment on 290d07a833d3c55654e38a69934e3e022bd968fa, which resulted in 46c967903d39e02619c2172d1085c7d6cbb695b8. Those commits handled the default path when it is unset on startup. DEFAULT_PATH is used when PATH is unset at runtime as far as I can tell. As far as I can tell this has had the non-overidding ordering behavior since inception (or at least 17 years ago ea998b03f236be4e8af73474d994af5bbc4b0287). --- fish-rust/src/path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fish-rust/src/path.rs b/fish-rust/src/path.rs index 678dfa675..70607e680 100644 --- a/fish-rust/src/path.rs +++ b/fish-rust/src/path.rs @@ -187,10 +187,10 @@ pub fn path_get_path(cmd: &wstr, vars: &dyn Environment) -> Option { #[widestrs] static DEFAULT_PATH: Lazy<[WString; 3]> = Lazy::new(|| { [ - "/bin"L.to_owned(), - "/usr/bin"L.to_owned(), // TODO This should use env!. The fallback is only to appease "cargo test" for now. WString::from_str(option_env!("PREFIX").unwrap_or("/usr/local")) + "/bin"L, + "/usr/bin"L.to_owned(), + "/bin"L.to_owned(), ] });