mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-19 13:01:15 -03:00
Stop expanding globs in command position when performing error checking
Before running a command, or before importing a command from bash history, we perform error checking. As part of error checking we expand commands including variables and globs. If the glob is very large, like `/**`, then we could hang expanding it. One fix would be to limit the amount of expansion from the glob, but instead let's just not expand command globs when performing error checking. Fixes #7407
This commit is contained in:
@@ -1136,7 +1136,8 @@ static bool detect_errors_in_decorated_statement(const wcstring &buff_src,
|
||||
wcstring command;
|
||||
// Check that we can expand the command.
|
||||
if (expand_to_command_and_args(unexp_command, operation_context_t::empty(), &command,
|
||||
nullptr, parse_errors) == expand_result_t::error) {
|
||||
nullptr, parse_errors,
|
||||
true /* skip wildcards */) == expand_result_t::error) {
|
||||
errored = true;
|
||||
parse_error_offset_source_start(parse_errors, source_start);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user