[packages/mksh] reword comment in exit-trap patch

arekm arekm at pld-linux.org
Tue Sep 8 17:16:44 CEST 2026


commit 6f90212793ae1017db133ab68ebf0ecd46795628
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Sep 8 17:15:49 2026 +0200

    reword comment in exit-trap patch

 mksh-exit-trap-status.patch | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/mksh-exit-trap-status.patch b/mksh-exit-trap-status.patch
index 3cdb700..a34faa9 100644
--- a/mksh-exit-trap-status.patch
+++ b/mksh-exit-trap-status.patch
@@ -36,14 +36,15 @@ diff -urNp mksh-59c.org/check.t mksh-59c/check.t
 diff -urNp mksh-59c.org/main.c mksh-59c/main.c
 --- mksh-59c.org/main.c	2020-10-01 22:29:21.000000000 +0200
 +++ mksh-59c/main.c	2026-09-08 16:21:20.628320872 +0200
-@@ -977,9 +977,17 @@ unwind(int i)
+@@ -977,9 +977,18 @@ unwind(int i)
  	if (i == LEXIT || ((i == LERROR || i == LERREXT || i == LINTR) &&
  	    sigtraps[ksh_SIGEXIT].trap &&
  	    (!Flag(FTALKING) || Flag(FERREXIT)))) {
 +		/*
-+		 * $? after a trap action must be what it was before it
-+		 * (POSIX); nested here (signal or another trap) runtrap()
-+		 * never gets its is_last call, so restore the status here
++		 * POSIX: $? after a trap action is the value it had before
++		 * the action ran. When we get here from a signal or from
++		 * another trap, runtrap() is nested and never sees is_last,
++		 * so restore it here.
 +		 */
 +		int saved_exstat = exstat;
 +
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mksh.git/commitdiff/6f90212793ae1017db133ab68ebf0ecd46795628



More information about the pld-cvs-commit mailing list