mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-24 17:41:16 -03:00
replace var_entry_t with env_var_t
This is a step to storing fish vars as actual vectors rather than flat strings.
This commit is contained in:
@@ -48,20 +48,18 @@ static bool path_get_path_core(const wcstring &cmd, wcstring *out_path,
|
||||
}
|
||||
|
||||
int err = ENOENT;
|
||||
wcstring bin_path;
|
||||
wcstring_list_t pathsv;
|
||||
if (!bin_path_var.missing()) {
|
||||
bin_path = bin_path_var.as_string();
|
||||
bin_path_var.to_list(pathsv);
|
||||
} else {
|
||||
// Note that PREFIX is defined in the `Makefile` and is thus defined when this module is
|
||||
// compiled. This ensures we always default to "/bin", "/usr/bin" and the bin dir defined
|
||||
// for the fish programs. Possibly with a duplicate dir if PREFIX is empty, "/", "/usr" or
|
||||
// "/usr/". If the PREFIX duplicates /bin or /usr/bin that is harmless other than a trivial
|
||||
// amount of time testing a path we've already tested.
|
||||
bin_path = *list_to_array_val(wcstring_list_t({L"/bin", L"/usr/bin", PREFIX L"/bin"}));
|
||||
pathsv = wcstring_list_t({L"/bin", L"/usr/bin", PREFIX L"/bin"});
|
||||
}
|
||||
|
||||
wcstring_list_t pathsv;
|
||||
bin_path_var.to_list(pathsv);
|
||||
for (auto next_path : pathsv) {
|
||||
if (next_path.empty()) continue;
|
||||
append_path_component(next_path, cmd);
|
||||
|
||||
Reference in New Issue
Block a user