From 1c5404fd1bdf0c3a10ffa014bed331112b7f0d30 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Debian Linux)" <rob@synchro.net>
Date: Sun, 12 Mar 2023 14:17:59 -0700
Subject: [PATCH] Better to just break this loop than to call exit()

exit()ing from a load()ed script can cause the parent script to terminate and
we don't want that.
---
 exec/msgscancfg.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec/msgscancfg.js b/exec/msgscancfg.js
index bcd159eebe..547002a6c0 100644
--- a/exec/msgscancfg.js
+++ b/exec/msgscancfg.js
@@ -6,7 +6,7 @@ require("sbbsdefs.js", "USER_EXPERT");
 
 const menufile = "maincfg";
 
-while(bbs.online) {
+while(bbs.online && !js.terminated) {
 	if(!(user.settings & USER_EXPERT))
 		bbs.menu(menufile);
 	bbs.nodesync();
@@ -40,5 +40,5 @@ while(bbs.online) {
 			console.print("\r\nMessage scan configuration and pointers saved.\r\n");
 			break;
 	}
-	exit();
+	break;
 }
-- 
GitLab