Skip to content

Commit

Permalink
Re-use DEFAULT_PATH in setup_path
Browse files Browse the repository at this point in the history
- No need to hard-code a different default
  • Loading branch information
henrikhorluck committed Aug 20, 2023
1 parent 3205278 commit a5f4a4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fish-rust/src/env/environment.rs
Expand Up @@ -512,7 +512,7 @@ fn setup_path() {
str2wcstring(cstr.to_bytes())
} else {
// the above should really not fail
L!("/usr/bin:/bin").to_owned()
join_strings(crate::path::DEFAULT_PATH.as_ref(), ':')
};

vars.set_one(L!("PATH"), EnvMode::GLOBAL | EnvMode::EXPORT, path);
Expand Down
2 changes: 1 addition & 1 deletion fish-rust/src/path.rs
Expand Up @@ -185,7 +185,7 @@ pub fn path_get_path(cmd: &wstr, vars: &dyn Environment) -> Option<WString> {

// PREFIX is defined at build time.
#[widestrs]
static DEFAULT_PATH: Lazy<[WString; 3]> = Lazy::new(|| {
pub static DEFAULT_PATH: Lazy<[WString; 3]> = Lazy::new(|| {
[
"/bin"L.to_owned(),
"/usr/bin"L.to_owned(),
Expand Down

0 comments on commit a5f4a4c

Please sign in to comment.