From 70cedf3603ba648166de9c0e49f6d88f061c4fdc Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Mon, 11 May 2020 03:58:04 +0000
Subject: [PATCH] Now that pause() can set a hot-spot, don't inject a Ctrl-C
 (abort) into the keyboard buffer if it had.

---
 src/sbbs3/getkey.cpp | 7 ++++---
 src/sbbs3/inkey.cpp  | 2 +-
 src/sbbs3/main.cpp   | 1 +
 src/sbbs3/sbbs.h     | 1 +
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/sbbs3/getkey.cpp b/src/sbbs3/getkey.cpp
index 7fc4e2ba55..739f7ff2bf 100644
--- a/src/sbbs3/getkey.cpp
+++ b/src/sbbs3/getkey.cpp
@@ -552,7 +552,6 @@ void sbbs_t::pause()
 	uint	tempattrs=curatr; /* was lclatr(-1) */
 	long	l=K_UPPER;
 	size_t	len;
-	struct mouse_hotspot* hotspot_added = NULL;
 
  	if((sys_status&SS_ABORT) || pause_inside)
 		return;
@@ -561,15 +560,17 @@ void sbbs_t::pause()
 	if(online==ON_REMOTE)
 		rioctl(IOFI);
 	if(mouse_hotspots.first == NULL)
-		hotspot_added = add_hotspot('\r');
+		pause_hotspot = add_hotspot('\r');
 	bputs(text[Pause]);
 	len = bstrlen(text[Pause]);
 	if(sys_status&SS_USERON && !(useron.misc&(HTML|WIP|NOPAUSESPIN))
 		&& !(cfg.node_misc&NM_NOPAUSESPIN))
 		l|=K_SPIN;
 	ch=getkey(l);
-	if(hotspot_added)
+	if(pause_hotspot) {
 		clear_hotspots();
+		pause_hotspot = NULL;
+	}
 	if(ch==text[YNQP][1] || ch==text[YNQP][2])
 		sys_status|=SS_ABORT;
 	else if(ch==LF)	// down arrow == display one more line
diff --git a/src/sbbs3/inkey.cpp b/src/sbbs3/inkey.cpp
index 35564b0b58..a3e2db4b91 100644
--- a/src/sbbs3/inkey.cpp
+++ b/src/sbbs3/inkey.cpp
@@ -375,7 +375,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
 						}
 #endif
 						ungetstr(spot->cmd);
-						if(pause_inside)
+						if(pause_inside && pause_hotspot == NULL)
 							return handle_ctrlkey(TERM_KEY_ABORT, mode);
 						return 0;
 					}
diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index d9b9f38140..147f106c3e 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -3363,6 +3363,7 @@ sbbs_t::sbbs_t(ushort node_num, union xp_sockaddr *addr, size_t addr_len, const
 
 	mouse_mode = MOUSE_MODE_OFF;
 	hungry_hotspots = true;
+	pause_hotspot = NULL;
 	console = 0;
 	online = 0;
 	outchar_esc = 0;
diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h
index a368520b3b..a817347351 100644
--- a/src/sbbs3/sbbs.h
+++ b/src/sbbs3/sbbs.h
@@ -831,6 +831,7 @@ public:
 	uint	hot_attr;			// Auto-Mouse hot-spot attribute (when non-zero)
 	bool	hungry_hotspots;
 	link_list_t mouse_hotspots;	// Mouse hot-spots
+	struct mouse_hotspot* pause_hotspot;
 	struct mouse_hotspot* add_hotspot(struct mouse_hotspot*);
 	struct mouse_hotspot* add_hotspot(char cmd, bool hungry = true, long minx = -1, long maxx = -1, long y = -1);
 	struct mouse_hotspot* add_hotspot(ulong num, bool hungry = true, long minx = -1, long maxx = -1, long y = -1);
-- 
GitLab