mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-01 18:30:55 +01:00
20325: consensus fix for "command -v" crash w/POSIXBUILTINS.
This commit is contained in:
parent
72fdf24448
commit
e1d5c7df58
1 changed files with 13 additions and 2 deletions
15
Src/exec.c
15
Src/exec.c
|
|
@ -1825,7 +1825,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
|
|||
load_module(((Builtin) hn)->optstr);
|
||||
hn = builtintab->getnode(builtintab, cmdarg);
|
||||
}
|
||||
assign = (hn->flags & BINF_MAGICEQUALS);
|
||||
assign = (hn && (hn->flags & BINF_MAGICEQUALS));
|
||||
break;
|
||||
}
|
||||
cflags &= ~BINF_BUILTIN & ~BINF_COMMAND;
|
||||
|
|
@ -1939,7 +1939,18 @@ execcmd(Estate state, int input, int output, int how, int last1)
|
|||
return;
|
||||
}
|
||||
|
||||
if (errflag || checked ||
|
||||
/*
|
||||
* Quit looking for a command if:
|
||||
* - there was an error; or
|
||||
* - we checked the simple cases needing MAGIC_EQUAL_SUBST; or
|
||||
* - we know we already found a builtin (because either:
|
||||
* - we loaded a builtin from a module, or
|
||||
* - we have determined there are options which would
|
||||
* require us to use the "command" builtin); or
|
||||
* - we aren't using POSIX and so BINF_COMMAND indicates a zsh
|
||||
* precommand modifier is being used in place of the builtin
|
||||
*/
|
||||
if (errflag || checked || is_builtin ||
|
||||
(unset(POSIXBUILTINS) && (cflags & BINF_COMMAND)))
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue