Skip to content

Commit 126bfc8

Browse files
committed
execute_cmd: always search for special builtins during simple command exec
This allows externally registered special builtins to always override functions even when bash isn't built with strict posix mode enabled. This will also have the affect that special builtins native to bash, e.g. exit and source (see the full list via `enable -s`), won't be able to be overridden by functions which in our case shouldn't matter and probably is a good thing anyway.
1 parent 6ae1d89 commit 126bfc8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

execute_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4670,7 +4670,7 @@ execute_simple_command (SIMPLE_COM *simple_command, int pipe_in, int pipe_out, i
46704670
being used, and we don't want to exit the shell if a special
46714671
builtin executed with `command builtin' fails. `command' is not
46724672
a special builtin. */
4673-
if (posixly_correct)
4673+
if (posixly_correct || BUILD_LIBRARY)
46744674
{
46754675
builtin = find_special_builtin (words->word->word);
46764676
if (builtin)

0 commit comments

Comments
 (0)