From bbccbe0c85887bfc15c57a0c5eb97e59f7cb9fa7 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Tue, 9 Oct 2018 14:38:26 +0100
Subject: 43660: extend 43653 when final exit is implicit.
Combine logic for case after committed to exit (shell_exiting) with
case where exit occurred in a function we nee to unwind (exit_pending).
Add sarky note for future generations to be confused at.
---
Test/C03traps.ztst | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'Test')
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index eab01e5c1..bab0b0a0c 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -869,6 +869,10 @@ F:Must be tested with a top-level script rather than source or function
$ZTST_testdir/../Src/zsh -fc 'fn() { exit $?+8; }; trap fn EXIT; exit 7'
15:Progated exit status through exit trap
+ $ZTST_testdir/../Src/zsh -fc 'fn() { exit 13; }; trap fn EXIT'
+13:Explicit exit in exit trap overrides implicit exit status
+
%clean
rm -f TRAPEXIT
+
--
cgit 1.4.1