1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 22:32:12 +02:00

37434: POSIXBUILTINS "command" should prevent shell exit on errors from special builtins

This commit is contained in:
Barton E. Schaefer 2015-12-25 00:26:26 -08:00
parent 038b1d4b38
commit a554c7403a
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2015-12-25 Barton E. Schaefer <schaefer@zsh.org>
* 37434: Src/exec.c: POSIXBUILTINS "command" should prevent shell
exit on errors from special builtins
2015-12-23 Philip Sequeira <phsequei@gmail.com>
* 37345: Functions/VCS_Info/VCS_INFO_maxexports,

View file

@ -3475,10 +3475,10 @@ execcmd(Estate state, int input, int output, int how, int last1)
restore_queue_signals(q);
} else if (is_builtin || is_shfunc) {
LinkList restorelist = 0, removelist = 0;
int do_save = 0;
/* builtin or shell function */
if (!forked && varspc) {
int do_save = 0;
if (!forked) {
if (isset(POSIXBUILTINS)) {
/*
* If it's a function or special builtin --- save
@ -3497,7 +3497,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
if ((cflags & BINF_COMMAND) || !assign)
do_save = 1;
}
if (do_save)
if (do_save && varspc)
save_params(state, varspc, &restorelist, &removelist);
}
if (varspc) {
@ -3643,6 +3643,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
}
dont_queue_signals();
lastval = execbuiltin(args, assigns, (Builtin) hn);
if (do_save & BINF_COMMAND)
errflag &= ~ERRFLAG_ERROR;
restore_queue_signals(q);
fflush(stdout);
if (save[1] == -2) {