From 576d5d679bec55703d3dd6e77dfca2912d1f6be6 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 31 Aug 2011 21:24:50 +0000
Subject: [PATCH] Fix bug introduced in rev 1.44: a js.on_exit()  handler could
 not change the value of js.auto_terminate (e.g. the irc.js could not restore
 the original value, thus re-enabling auto-terminate upon exit of the IRC
 client).

---
 src/sbbs3/js_internal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/js_internal.c b/src/sbbs3/js_internal.c
index f096aa79db..e24e109366 100644
--- a/src/sbbs3/js_internal.c
+++ b/src/sbbs3/js_internal.c
@@ -446,7 +446,8 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_branch_t* branch)
 
 	strListFree(&branch->exit_func);
 
-	branch->auto_terminate = auto_terminate;
+	if(auto_terminate)
+		branch->auto_terminate = TRUE;
 }
 
 JSObject* DLLCALL js_CreateInternalJsObject(JSContext* cx, JSObject* parent, js_branch_t* branch, js_startup_t* startup)
-- 
GitLab