From 11080465ad3759d4bdb3936026c797644c6f7f0b Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 11 Nov 2023 13:09:59 -0500 Subject: [PATCH] Corrected the Tcl exit hook routine so that it passes on the client data value as the exit status value (this was not at all clear from the documentation and required a bit of experimentation). The fix allows Tcl scripts to exit magic with a non-zero status by invoking "exit" in Tcl. --- VERSION | 2 +- utils/main.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 18544c7d..3fdb0d21 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.446 +8.3.447 diff --git a/utils/main.c b/utils/main.c index 53ce7ab4..a896f415 100644 --- a/utils/main.c +++ b/utils/main.c @@ -791,10 +791,16 @@ mainInitAfterArgs() return 0; } +/* + * Tcl exit procedure hook for the Tcl_Exit() subroutine + * + * clientData is an exit value if "exit" was specified from a script. + */ + void tcl_exit_hook(ClientData clientData) { TxResetTerminal(); - exit(0); + exit((int)clientData); } /*