Skip to content

Commit

Permalink
Make DEFAULT_PATH allow overriding system binaries
Browse files Browse the repository at this point in the history
This is in regards to a comment on 290d07a, which resulted in 46c9679.
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 ea998b0).
  • Loading branch information
henrikhorluck committed Aug 20, 2023
1 parent a2aee47 commit 75c6181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fish-rust/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ pub fn path_get_path(cmd: &wstr, vars: &dyn Environment) -> Option<WString> {
#[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(),
]
});

Expand Down

0 comments on commit 75c6181

Please sign in to comment.