From 0e4aa6f2f64fb276537adecfe755a752a3fcccb1 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 5 Dec 2016 12:29:23 +0000 Subject: Additional case for ERR_RETURN and ERR_EXIT. Don't trigger just because status is non-zero at end of current shell group. --- Test/C03traps.ztst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Test') diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index e94fb6f85..dc386a44e 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -661,6 +661,15 @@ F:Must be tested with a top-level script rather than source or function print OK ) 0:ERR_EXIT not triggered by status 1 at end of if +>OK + + (setopt err_exit + { + false && true + } + print OK + ) +0:ERR_EXIT not triggered by status 1 at end of { } >OK (setopt err_exit @@ -696,6 +705,14 @@ F:Must be tested with a top-level script rather than source or function ) 1:ERR_EXIT triggered by status 1 within if + (setopt err_exit + { + false + } + print OK + ) +1:ERR_EXIT triggered by status 1 within { } + if zmodload zsh/system 2>/dev/null; then ( trap 'echo TERM; exit 2' TERM -- cgit 1.4.1