Only use the global fish_complete_path and fish_function_path

Prior to this fix, fish would attempt to react if a local fish_complete_path
or fish_function_path were set. However this has never been very well tested
and will become impossible with concurrent execution. Always use the global
values.
This commit is contained in:
ridiculousfish
2019-07-12 12:19:00 -07:00
parent 7ee675afcf
commit d577eb4aaa
3 changed files with 5 additions and 3 deletions

View File

@@ -873,8 +873,9 @@ static void complete_load(const wcstring &name) {
// It's important to NOT hold the lock around completion loading.
// We need to take the lock to decide what to load, drop it to perform the load, then reacquire
// it.
const environment_t &vars = parser_t::principal_parser().vars();
maybe_t<wcstring> path_to_load = completion_autoloader.acquire()->resolve_command(name, vars);
// Note we only look at the global fish_function_path and fish_completion_path.
maybe_t<wcstring> path_to_load =
completion_autoloader.acquire()->resolve_command(name, env_stack_t::globals());
if (path_to_load) {
autoload_t::perform_autoload(*path_to_load, parser);
completion_autoloader.acquire()->mark_autoload_finished(name);