From d22da92d5acffe8465d87f70356b493dca286a81 Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Sat, 21 Jan 2023 21:47:55 -0800
Subject: [PATCH] Better handling of Quit/Ctrl-C at default protocol selection

IF user hits 'Q' (or whatever the "Quit" key is), set the default protocol
field in the user record to " " (instead of an empty string).
If user hits abort (Ctrl-C), don't make any change to the default protocol.
---
 src/sbbs3/useredit.cpp | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/sbbs3/useredit.cpp b/src/sbbs3/useredit.cpp
index 2393795318..5b6f4b6368 100644
--- a/src/sbbs3/useredit.cpp
+++ b/src/sbbs3/useredit.cpp
@@ -1092,15 +1092,13 @@ void sbbs_t::maindflts(user_t* user)
 						strcat(str,tmp); 
 					}
 				ch=(char)getkeys(str,0);
-				if(ch==quit_key() || sys_status&SS_ABORT) {
+				if(sys_status & SS_ABORT)
+					break;
+				if(ch==quit_key())
 					ch=' ';
-					putuserstr(user->number, USER_PROT, ""); 
-				}
-				else {
-					tmp[0] = ch;
-					tmp[1] = '\0';
-					putuserstr(user->number, USER_PROT, tmp);
-				}
+				tmp[0] = ch;
+				tmp[1] = '\0';
+				putuserstr(user->number, USER_PROT, tmp);
 				if(yesno(text[HangUpAfterXferQ]))
 					user->misc|=AUTOHANG;
 				else
-- 
GitLab