30876: fix obscure failures to propagate non-zero status

from optimised simple commands within lists
interrupt_abort
Peter Stephenson 12 years ago
parent 431c22024d
commit 1869eeb393

@ -1,3 +1,9 @@
2012-12-13 Peter Stephenson <pws@csr.com>
* 30876: Src/exec.c, Test/A06assign.ztst, Test/C03traps.ztst:
obscure failures to process non-zero return values could result
from optimising a list to a simple command.
2012-12-08 Bart Schaefer <schaefer@zsh.org>
* users/17445: Src/math.c, Test/C01arith.ztst: fix handling of
@ -368,5 +374,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5766 $
* $Revision: 1.5767 $
*****************************************************

@ -2019,7 +2019,7 @@ _perforce_cmd_fix() {
'-s[set job status]:status:_perforce_statuses' \
'1::-c required:(-c)' \
'2::change:_perforce_changes' \
"3::job:_perforce_jobs$job"
"*::job:_perforce_jobs$job"
}

@ -1207,6 +1207,9 @@ execlist(Estate state, int dont_change_job, int exiting)
} else
donedebug = intrap ? 1 : 0;
/* Reset donetrap: this ensures that a trap is only *
* called once for each sublist that fails. */
donetrap = 0;
if (ltype & Z_SIMPLE) {
next = state->pc + WC_LIST_SKIP(code);
if (donedebug != 2)
@ -1214,9 +1217,6 @@ execlist(Estate state, int dont_change_job, int exiting)
state->pc = next;
goto sublist_done;
}
/* Reset donetrap: this ensures that a trap is only *
* called once for each sublist that fails. */
donetrap = 0;
/* Loop through code followed by &&, ||, or end of sublist. */
code = *state->pc++;

@ -184,8 +184,8 @@
typeset -A hash
hash=(one 1)
h+=string
[[ $h[@] == string ]]
hash+=string
[[ $hash[@] == string ]]
0:add scalar to association
# tests of var+=(array)

@ -388,6 +388,17 @@
>}
>No, really exited
(set -e
printf "a\nb\n" | while read line
do
[[ $line = a* ]] || continue
((ctr++))
[[ $line = foo ]]
done
echo "ctr = $ctr"
)
1:ERREXIT in loop with simple commands
%clean
rm -f TRAPEXIT

Loading…
Cancel
Save