From 77a2cda00604447f83b95616ba92a55d6fa46cfe Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 21 Jul 2011 11:19:22 +0000
Subject: [PATCH] Enhancement: most question-type text.dat entries are now
 optional. That is, if any of the following text.dat entries are set to a
 blank/emtpy string (by editing ctrl/text.dat or via run-time script
 modification), the question will not be asked of the user allowing greater
 sysop-customization of hard-coded processes (e.g. new user application):
 ClearUploadQueueQ ClearDownloadQueueQ HangUpAfterXferQ ChatWithGuruInsteadQ
 ForwardMailQ DownloadBatchQ LogOffQ DeleteErrorLogQ ClearErrCounter
 DeleteGuruLogQ AutoTerminalQ AnsiTerminalQ ColorTerminalQ ExAsciiTerminalQ
 CallingFromNorthAmericaQ ReadYourMailNowQ NScanAllGrpsQ SScanAllGrpsQ
 NewPasswordQ ContinueQ EnterYourPhoneNumber UserInfoCorrectQ
 UseExternalEditorQ DownloadAttachedFileQ AddSubToNewScanQ (new)
 RemoveFromNewScanQ DisplaySubjectsOnlyQ Post SearchExtendedQ ViewSysInfoFileQ
 ViewLogonMsgQ WithLineNumbersQ

---
 src/sbbs3/bat_xfer.cpp |  6 +++---
 src/sbbs3/chat.cpp     |  4 ++--
 src/sbbs3/download.cpp | 10 ++++++----
 src/sbbs3/email.cpp    |  4 ++--
 src/sbbs3/execfile.cpp |  4 ++--
 src/sbbs3/execfunc.cpp |  8 ++++----
 src/sbbs3/logon.cpp    | 17 ++++++++++-------
 src/sbbs3/newuser.cpp  | 29 ++++++++++++++++-------------
 src/sbbs3/readmail.cpp |  4 ++--
 src/sbbs3/readmsgs.cpp | 34 +++++++++++++++-------------------
 src/sbbs3/scandirs.cpp |  6 +++---
 src/sbbs3/scansubs.cpp |  9 ++++++---
 src/sbbs3/str.cpp      | 23 +++++++++++++----------
 src/sbbs3/writemsg.cpp |  4 ++--
 14 files changed, 86 insertions(+), 76 deletions(-)

diff --git a/src/sbbs3/bat_xfer.cpp b/src/sbbs3/bat_xfer.cpp
index 71d9c1865d..830fd4ea35 100644
--- a/src/sbbs3/bat_xfer.cpp
+++ b/src/sbbs3/bat_xfer.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -186,13 +186,13 @@ void sbbs_t::batchmenu()
 				break;
 			case 'C':
 				if(batup_total) {
-					if(!noyes(text[ClearUploadQueueQ])) {
+					if(text[ClearUploadQueueQ][0]==0 || !noyes(text[ClearUploadQueueQ])) {
 						batup_total=0;
 						bputs(text[UploadQueueCleared]); 
 					} 
 				}
 				if(batdn_total) {
-					if(!noyes(text[ClearDownloadQueueQ])) {
+					if(text[ClearDownloadQueueQ][0]==0 || !noyes(text[ClearDownloadQueueQ])) {
 						for(i=0;i<batdn_total;i++) {
 							f.dir=batdn_dir[i];
 							f.datoffset=batdn_offset[i];
diff --git a/src/sbbs3/chat.cpp b/src/sbbs3/chat.cpp
index 2dbb520eca..d16c17b18f 100644
--- a/src/sbbs3/chat.cpp
+++ b/src/sbbs3/chat.cpp
@@ -658,8 +658,8 @@ void sbbs_t::chatsection()
 				no_rip_menu=1;
 				if(sysop_page())
 					break;
-				if(cfg.total_gurus && chk_ar(cfg.guru[0]->ar,&useron,&client)) {
-					sprintf(str,text[ChatWithGuruInsteadQ],cfg.guru[0]->name);
+				if(cfg.total_gurus && chk_ar(cfg.guru[0]->ar,&useron,&client) && text[ChatWithGuruInsteadQ][0]) {
+					SAFEPRINTF(str,text[ChatWithGuruInsteadQ],cfg.guru[0]->name);
 					if(!yesno(str))
 						break; 
 				}
diff --git a/src/sbbs3/download.cpp b/src/sbbs3/download.cpp
index e4e64b3771..5d3e3c3e3d 100644
--- a/src/sbbs3/download.cpp
+++ b/src/sbbs3/download.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -206,11 +206,13 @@ int sbbs_t::protocol(prot_t* prot, enum XFER_TYPE type
 	sprintf(protlog,"%sPROTOCOL.LOG",cfg.node_dir);
 	remove(protlog);                        /* Deletes the protocol log */
 	if(useron.misc&AUTOHANG)
-		autohang=1;
-	else
+		autohang=true;
+	else if(text[HangUpAfterXferQ][0])
 		autohang=yesno(text[HangUpAfterXferQ]);
+	else
+		autohang=false;
 	if(sys_status&SS_ABORT || !online) {	/* if ctrl-c or hangup */
-		autohang=0;
+		autohang=false;
 		return(-1); 
 	}
 	bputs(text[StartXferNow]);
diff --git a/src/sbbs3/email.cpp b/src/sbbs3/email.cpp
index 05d9206ed2..bf4e995460 100644
--- a/src/sbbs3/email.cpp
+++ b/src/sbbs3/email.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -92,7 +92,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode)
 	if(l&NETMAIL && cfg.sys_misc&SM_FWDTONET) {
 		getuserrec(&cfg,usernumber,U_NETMAIL,LEN_NETMAIL,str);
 		bprintf(text[UserNetMail],str);
-		if(yesno(text[ForwardMailQ])) /* Forward to netmail address */
+		if(text[ForwardMailQ][0]==0 || yesno(text[ForwardMailQ])) /* Forward to netmail address */
 			return(netmail(str,subj,mode));
 	}
 	bprintf(text[Emailing],username(&cfg,usernumber,tmp),usernumber);
diff --git a/src/sbbs3/execfile.cpp b/src/sbbs3/execfile.cpp
index 921c8f6889..dc5774211b 100644
--- a/src/sbbs3/execfile.cpp
+++ b/src/sbbs3/execfile.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -353,7 +353,7 @@ int sbbs_t::exec_file(csi_t *csi)
 				csi->logic=LOGIC_TRUE;
 			return(0);
 		case CS_FILE_DOWNLOAD_BATCH:
-			if(batdn_total && yesno(text[DownloadBatchQ])) {
+			if(batdn_total && (text[DownloadBatchQ][0]==0 || yesno(text[DownloadBatchQ]))) {
 				start_batch_download();
 				csi->logic=LOGIC_TRUE; 
 			}
diff --git a/src/sbbs3/execfunc.cpp b/src/sbbs3/execfunc.cpp
index 0961a61404..1ae2b1ece5 100644
--- a/src/sbbs3/execfunc.cpp
+++ b/src/sbbs3/execfunc.cpp
@@ -110,7 +110,7 @@ int sbbs_t::exec_function(csi_t *csi)
 			xtrn_sec();
 			return(0);
 		case CS_LOGOFF:
-			if(!noyes(text[LogOffQ])) {
+			if(text[LogOffQ][0]==0 || !noyes(text[LogOffQ])) {
 				if(cfg.logoff_mod[0])
 					exec_bin(cfg.logoff_mod,csi);
 				user_event(EVENT_LOGOFF);
@@ -276,7 +276,7 @@ int sbbs_t::exec_function(csi_t *csi)
 			if(fexist(str)) {
 				bputs(text[ErrorLogHdr]);
 				printfile(str,0);
-				if(!noyes(text[DeleteErrorLogQ]))
+				if(text[DeleteErrorLogQ][0] && !noyes(text[DeleteErrorLogQ]))
 					remove(str); 
 			}
 			else
@@ -287,7 +287,7 @@ int sbbs_t::exec_function(csi_t *csi)
 					break; 
 			}
 			if(i<=cfg.sys_nodes || criterrs) {
-				if(!noyes(text[ClearErrCounter])) {
+				if(text[ClearErrCounter][0]==0 || !noyes(text[ClearErrCounter])) {
 					for(i=1;i<=cfg.sys_nodes;i++) {
 						if(getnodedat(i,&node,true)==0) {
 							node.errors=0;
@@ -322,7 +322,7 @@ int sbbs_t::exec_function(csi_t *csi)
 			if(fexist(str)) {
 				printfile(str,0);
 				CRLF;
-				if(!noyes(text[DeleteGuruLogQ]))
+				if(text[DeleteGuruLogQ][0] && !noyes(text[DeleteGuruLogQ]))
 					remove(str); 
 			}
 			return(0);
diff --git a/src/sbbs3/logon.cpp b/src/sbbs3/logon.cpp
index 3758711c0c..1030901a1b 100644
--- a/src/sbbs3/logon.cpp
+++ b/src/sbbs3/logon.cpp
@@ -79,12 +79,12 @@ bool sbbs_t::logon()
 		useron.rows=0;
 		useron.misc&=~(ANSI|RIP|WIP|NO_EXASCII|COLOR|HTML);
 		useron.misc|=autoterm;
-		if(!(useron.misc&ANSI) && yesno(text[AnsiTerminalQ]))
+		if(!(useron.misc&ANSI) && text[AnsiTerminalQ][0] && yesno(text[AnsiTerminalQ]))
 			useron.misc|=ANSI;
 		if(useron.misc&(RIP|WIP|HTML)
-			|| (useron.misc&ANSI && yesno(text[ColorTerminalQ])))
+			|| (useron.misc&ANSI && text[ColorTerminalQ][0] && yesno(text[ColorTerminalQ])))
 			useron.misc|=COLOR;
-		if(!yesno(text[ExAsciiTerminalQ]))
+		if(text[ExAsciiTerminalQ][0] && !yesno(text[ExAsciiTerminalQ]))
 			useron.misc|=NO_EXASCII;
 		for(i=0;i<cfg.total_xedits;i++)
 			if(!stricmp(cfg.xedit[i]->code,cfg.new_xedit)
@@ -344,7 +344,10 @@ bool sbbs_t::logon()
 						break; 
 				}
 			if(cfg.uq&UQ_PHONE && !useron.phone[0]) {
-				i=yesno(text[CallingFromNorthAmericaQ]);
+				if(text[CallingFromNorthAmericaQ][0])
+					i=yesno(text[CallingFromNorthAmericaQ]);
+				else
+					i=0;
 				while(online) {
 					bputs(text[EnterYourPhoneNumber]);
 					if(i) {
@@ -514,13 +517,13 @@ bool sbbs_t::logon()
 	sys_status&=~SS_PAUSEON;	/* Turn off the pause override flag */
 	if(online==ON_REMOTE)
 		rioctl(IOSM|ABORT);		/* Turn abort ability on */
-	if(mailw) {
+	if(text[ReadYourMailNowQ][0] && mailw) {
 		if(yesno(text[ReadYourMailNowQ]))
 			readmail(useron.number,MAIL_YOUR); 
 	}
-	if(usrgrps && useron.misc&ASK_NSCAN && yesno(text[NScanAllGrpsQ]))
+	if(usrgrps && useron.misc&ASK_NSCAN && text[NScanAllGrpsQ][0] && yesno(text[NScanAllGrpsQ]))
 		scanallsubs(SCAN_NEW);
-	if(usrgrps && useron.misc&ASK_SSCAN && yesno(text[SScanAllGrpsQ]))
+	if(usrgrps && useron.misc&ASK_SSCAN && text[SScanAllGrpsQ][0] && yesno(text[SScanAllGrpsQ]))
 		scanallsubs(SCAN_TOYOU);
 	return(true);
 }
diff --git a/src/sbbs3/newuser.cpp b/src/sbbs3/newuser.cpp
index 633c21c2d4..12210116fc 100644
--- a/src/sbbs3/newuser.cpp
+++ b/src/sbbs3/newuser.cpp
@@ -160,14 +160,14 @@ BOOL sbbs_t::newuser()
 
 	while(online) {
 
-		if(autoterm || yesno(text[AutoTerminalQ])) {
+		if(autoterm || (text[AutoTerminalQ][0] && yesno(text[AutoTerminalQ]))) {
 			useron.misc|=AUTOTERM;
 			useron.misc|=autoterm; 
 		} else
 			useron.misc&=~AUTOTERM;
 
 		if(!(useron.misc&AUTOTERM)) {
-			if(yesno(text[AnsiTerminalQ]))
+			if(text[AnsiTerminalQ][0] && yesno(text[AnsiTerminalQ]))
 				useron.misc|=ANSI; 
 			else
 				useron.misc&=~ANSI;
@@ -175,14 +175,14 @@ BOOL sbbs_t::newuser()
 
 		if(useron.misc&ANSI) {
 			useron.rows=0;	/* Auto-rows */
-			if(useron.misc&(RIP|WIP|HTML) || yesno(text[ColorTerminalQ]))
+			if(useron.misc&(RIP|WIP|HTML) || text[ColorTerminalQ][0]==0 || yesno(text[ColorTerminalQ]))
 				useron.misc|=COLOR; 
 			else
 				useron.misc&=~COLOR;
 		}
 		else
 			useron.rows=24;
-		if(!yesno(text[ExAsciiTerminalQ]))
+		if(text[ExAsciiTerminalQ][0] && !yesno(text[ExAsciiTerminalQ]))
 			useron.misc|=NO_EXASCII;
 		else
 			useron.misc&=~NO_EXASCII;
@@ -204,7 +204,7 @@ BOOL sbbs_t::newuser()
 			if (!check_name(&cfg,useron.alias)
 				|| (!(cfg.uq&UQ_ALIASES) && !strchr(useron.alias,' '))) {
 				bputs(text[YouCantUseThatName]);
-				if(!yesno(text[ContinueQ]))
+				if(text[ContinueQ][0] && !yesno(text[ContinueQ]))
 					return(FALSE);
 				continue;
 			}
@@ -222,7 +222,7 @@ BOOL sbbs_t::newuser()
 					bputs(text[YouCantUseThatName]);
 				else
 					break; 
-				if(!yesno(text[ContinueQ]))
+				if(text[ContinueQ][0] && !yesno(text[ContinueQ]))
 					return(FALSE);
 			} 
 		}
@@ -246,7 +246,7 @@ BOOL sbbs_t::newuser()
 				bputs(text[YouCantUseThatName]);
 			else
 				break; 
-			if(!yesno(text[ContinueQ]))
+			if(text[ContinueQ][0] && !yesno(text[ContinueQ]))
 				return(FALSE);
 		}
 		if(!online) return(FALSE);
@@ -274,8 +274,11 @@ BOOL sbbs_t::newuser()
 			}
 		if(!online) return(FALSE);
 		if(cfg.uq&UQ_PHONE) {
-			usa=yesno(text[CallingFromNorthAmericaQ]);
-			while(online) {
+			if(text[CallingFromNorthAmericaQ][0])
+				usa=yesno(text[CallingFromNorthAmericaQ]);
+			else
+				usa=false;
+			while(online && text[EnterYourPhoneNumber][0]) {
 				bputs(text[EnterYourPhoneNumber]);
 				if(!usa) {
 					if(getstr(useron.phone,LEN_PHONE
@@ -309,11 +312,11 @@ BOOL sbbs_t::newuser()
 				&& !trashcan(useron.netmail,"email"))
 				break;
 		}
-		if(useron.netmail[0] && cfg.sys_misc&SM_FWDTONET && yesno(text[ForwardMailQ]))
+		if(useron.netmail[0] && cfg.sys_misc&SM_FWDTONET && text[ForwardMailQ][0] && yesno(text[ForwardMailQ]))
 			useron.misc|=NETMAIL;
 		else 
 			useron.misc&=~NETMAIL;
-		if(yesno(text[UserInfoCorrectQ]))
+		if(text[UserInfoCorrectQ][0]==0 || yesno(text[UserInfoCorrectQ]))
 			break; 
 	}
 	if(!online) return(FALSE);
@@ -345,7 +348,7 @@ BOOL sbbs_t::newuser()
 	if(i<cfg.total_xedits)
 		useron.xedit=i+1;
 
-	if(cfg.total_xedits && cfg.uq&UQ_XEDIT) {
+	if(cfg.total_xedits && cfg.uq&UQ_XEDIT && text[UseExternalEditorQ][0]) {
 		if(yesno(text[UseExternalEditorQ])) {
 			for(i=0;i<cfg.total_xedits;i++)
 				uselect(1,i,text[ExternalEditorHeading],cfg.xedit[i]->name,cfg.xedit[i]->ar);
@@ -377,7 +380,7 @@ BOOL sbbs_t::newuser()
 
 		bprintf(text[YourPasswordIs],useron.pass);
 
-		if(cfg.sys_misc&SM_PWEDIT && yesno(text[NewPasswordQ]))
+		if(cfg.sys_misc&SM_PWEDIT && text[NewPasswordQ][0] && yesno(text[NewPasswordQ]))
 			while(online) {
 				bputs(text[NewPassword]);
 				getstr(str,LEN_PASS,K_UPPER|K_LINE);
diff --git a/src/sbbs3/readmail.cpp b/src/sbbs3/readmail.cpp
index c10f64c266..582018a4ea 100644
--- a/src/sbbs3/readmail.cpp
+++ b/src/sbbs3/readmail.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -251,7 +251,7 @@ void sbbs_t::readmail(uint usernumber, int which)
 					else {
 						sprintf(str3,text[DownloadAttachedFileQ]
 							,tp,ultoac(length,tmp));
-						if(length>0L && yesno(str3)) {
+						if(length>0L && text[DownloadAttachedFileQ][0] && yesno(str3)) {
 							{	/* Remote User */
 								xfer_prot_menu(XFER_DOWNLOAD);
 								mnemonics(text[ProtocolOrQuit]);
diff --git a/src/sbbs3/readmsgs.cpp b/src/sbbs3/readmsgs.cpp
index 47317f6edf..743f6a447b 100644
--- a/src/sbbs3/readmsgs.cpp
+++ b/src/sbbs3/readmsgs.cpp
@@ -350,6 +350,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
 	char	find_buf[128];
 	char	tmp[128];
 	int		i;
+	int		quit=0;
 	uint 	usub,ugrp,reads=0;
 	uint	lp=0;
 	long	org_mode=mode;
@@ -687,13 +688,8 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
 		l=getkeys(str,smb.msgs);
 		if(l&0x80000000L) {
 			if((long)l==-1) { /* ctrl-c */
-				if(msg.total_hfields)
-					smb_freemsgmem(&msg);
-				if(post)
-					free(post);
-				smb_close(&smb);
-				smb_stack(&smb,SMB_STACK_POP);
-				return(1); 
+				quit=1;
+				break; 
 			}
 			smb.curmsg=(l&~0x80000000L)-1;
 			do_find=false;
@@ -723,7 +719,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
 					domsg=1;
 				break;
 			case 'B':   /* Skip sub-board */
-				if(mode&SCAN_NEW && !noyes(text[RemoveFromNewScanQ]))
+				if(mode&SCAN_NEW && text[RemoveFromNewScanQ][0] && !noyes(text[RemoveFromNewScanQ]))
 					subscan[subnum].cfg&=~SUB_CFG_NSCAN;
 				if(msg.total_hfields)
 					smb_freemsgmem(&msg);
@@ -829,7 +825,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
 				bputs(text[SearchStringPrompt]);
 				if(!getstr(find_buf,40,K_LINE|K_UPPER|K_EDIT|K_AUTODEL))
 					break;
-				if(yesno(text[DisplaySubjectsOnlyQ]))
+				if(text[DisplaySubjectsOnlyQ][0] && yesno(text[DisplaySubjectsOnlyQ]))
 					searchposts(subnum,post,(long)i,smb.msgs,find_buf);
 				else {
 					smb.curmsg=i;
@@ -909,13 +905,9 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
 				}
 				break;
 			case 'Q':   /* Quit */
-				if(msg.total_hfields)
-					smb_freemsgmem(&msg);
-				if(post)
-					free(post);
-				smb_close(&smb);
-				smb_stack(&smb,SMB_STACK_POP);
-				return(1);
+				quit=1;
+				done=1;
+				break;
 			case 'T':   /* List titles of next ten messages */
 				domsg=0;
 				if(!smb.msgs)
@@ -1153,17 +1145,21 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
 		smb_freemsgmem(&msg);
 	if(post)
 		free(post);
-	if(!(org_mode&(SCAN_CONST|SCAN_TOYOU|SCAN_FIND)) && !(cfg.sub[subnum]->misc&SUB_PONLY)
-		&& reads && chk_ar(cfg.sub[subnum]->post_ar,&useron,&client)
+	if(!quit
+		&& !(org_mode&(SCAN_CONST|SCAN_TOYOU|SCAN_FIND)) && !(cfg.sub[subnum]->misc&SUB_PONLY)
+		&& reads && chk_ar(cfg.sub[subnum]->post_ar,&useron,&client) && text[Post][0]
 		&& !(useron.rest&FLAG('P'))) {
 		sprintf(str,text[Post],cfg.grp[cfg.sub[subnum]->grp]->sname
 			,cfg.sub[subnum]->lname);
 		if(!noyes(str))
 			postmsg(subnum,0,0); 
 	}
+	if(!(org_mode&(SCAN_CONST|SCAN_TOYOU|SCAN_FIND))
+		&& !(subscan[subnum].cfg&SUB_CFG_NSCAN) && text[AddSubToNewScanQ][0] && yesno(text[AddSubToNewScanQ]))
+		subscan[subnum].cfg|=SUB_CFG_NSCAN;
 	smb_close(&smb);
 	smb_stack(&smb,SMB_STACK_POP);
-	return(0);
+	return(quit);
 }
 
 /****************************************************************************/
diff --git a/src/sbbs3/scandirs.cpp b/src/sbbs3/scandirs.cpp
index 2b2f68123f..49396779f1 100644
--- a/src/sbbs3/scandirs.cpp
+++ b/src/sbbs3/scandirs.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -65,7 +65,7 @@ void sbbs_t::scandirs(long mode)
 			padfname(tmp,str); 
 		}
 		else if(mode==FL_FINDDESC) {	/* Find text in description */
-			if(!noyes(text[SearchExtendedQ]))
+			if(text[SearchExtendedQ][0] && !noyes(text[SearchExtendedQ]))
 				mode=FL_EXFIND;
 			if(sys_status&SS_ABORT) {
 				lncntr=0;
@@ -136,7 +136,7 @@ void sbbs_t::scanalldirs(long mode)
 		padfname(tmp,str); 
 	}
 	else if(mode==FL_FINDDESC) {	/* Find text in description */
-		if(!noyes(text[SearchExtendedQ]))
+		if(text[SearchExtendedQ][0] && !noyes(text[SearchExtendedQ]))
 			mode=FL_EXFIND;
 		if(sys_status&SS_ABORT) {
 			lncntr=0;
diff --git a/src/sbbs3/scansubs.cpp b/src/sbbs3/scansubs.cpp
index 566cf828ae..17599439ce 100644
--- a/src/sbbs3/scansubs.cpp
+++ b/src/sbbs3/scansubs.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -53,7 +53,7 @@ void sbbs_t::scansubs(long mode)
 		return;
 
 	if(ch!='A' && mode&(SCAN_FIND|SCAN_TOYOU)) {
-		if(yesno(text[DisplaySubjectsOnlyQ])) i=1;
+		if(text[DisplaySubjectsOnlyQ][0] && yesno(text[DisplaySubjectsOnlyQ])) i=1;
 		if(mode&SCAN_FIND) {
 			bputs(text[SearchStringPrompt]);
 			if(!getstr(str,40,K_LINE|K_UPPER))
@@ -133,7 +133,10 @@ void sbbs_t::scanallsubs(long mode)
 	ulong	subs_scanned=0;
 
 	if(/* action==NODE_MAIN && */ mode&(SCAN_FIND|SCAN_TOYOU)) {
-		i=yesno(text[DisplaySubjectsOnlyQ]);
+		if(text[DisplaySubjectsOnlyQ][0])
+			i=yesno(text[DisplaySubjectsOnlyQ]);
+		else
+			i=0;
 		if(mode&SCAN_FIND) {
 			bputs(text[SearchStringPrompt]);
 			if(!getstr(str,40,K_LINE|K_UPPER))
diff --git a/src/sbbs3/str.cpp b/src/sbbs3/str.cpp
index f075b623d0..fb020ce872 100644
--- a/src/sbbs3/str.cpp
+++ b/src/sbbs3/str.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -778,7 +778,7 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
 /****************************************************************************/
 void sbbs_t::subinfo(uint subnum)
 {
-	char str[256];
+	char str[MAX_PATH+1];
 
 	bputs(text[SubInfoHdr]);
 	bprintf(text[SubInfoLongName],cfg.sub[subnum]->lname);
@@ -791,7 +791,7 @@ void sbbs_t::subinfo(uint subnum)
 		bprintf(text[SubInfoFidoNet]
 			,cfg.sub[subnum]->origline
 			,smb_faddrtoa(&cfg.sub[subnum]->faddr,str));
-	sprintf(str,"%s%s.msg",cfg.sub[subnum]->data_dir,cfg.sub[subnum]->code);
+	SAFEPRINTF2(str,"%s%s.msg",cfg.sub[subnum]->data_dir,cfg.sub[subnum]->code);
 	if(fexist(str) && yesno(text[SubInfoViewFileQ]))
 		printfile(str,0);
 }
@@ -801,7 +801,7 @@ void sbbs_t::subinfo(uint subnum)
 /****************************************************************************/
 void sbbs_t::dirinfo(uint dirnum)
 {
-	char str[256];
+	char str[MAX_PATH+1];
 
 	bputs(text[DirInfoHdr]);
 	bprintf(text[DirInfoLongName],cfg.dir[dirnum]->lname);
@@ -809,7 +809,7 @@ void sbbs_t::dirinfo(uint dirnum)
 	if(cfg.dir[dirnum]->exts[0])
 		bprintf(text[DirInfoAllowedExts],cfg.dir[dirnum]->exts);
 	bprintf(text[DirInfoMaxFiles],cfg.dir[dirnum]->maxfiles);
-	sprintf(str,"%s%s.msg",cfg.dir[dirnum]->data_dir,cfg.dir[dirnum]->code);
+	SAFEPRINTF2(str,"%s%s.msg",cfg.dir[dirnum]->data_dir,cfg.dir[dirnum]->code);
 	if(fexist(str) && yesno(text[DirInfoViewFileQ]))
 		printfile(str,0);
 }
@@ -855,22 +855,25 @@ void sbbs_t::sys_info()
 		bprintf(text[SiSysFaddr],smb_faddrtoa(&cfg.faddr[i],tmp));
 	if(cfg.sys_psname[0])				/* PostLink/PCRelay */
 		bprintf(text[SiSysPsite],cfg.sys_psname,cfg.sys_psnum);
-	bprintf(text[SiSysLocation],cfg.sys_location);
-	bprintf(text[SiSysop],cfg.sys_op);
+	if(cfg.sys_location[0])
+		bprintf(text[SiSysLocation],cfg.sys_location);
+	if(cfg.sys_op[0])
+		bprintf(text[SiSysop],cfg.sys_op);
 	bprintf(text[SiSysNodes],cfg.sys_nodes);
 //	bprintf(text[SiNodeNumberName],cfg.node_num,cfg.node_name);
-	bprintf(text[SiNodePhone],cfg.node_phone);
+	if(cfg.node_phone[0])
+		bprintf(text[SiNodePhone],cfg.node_phone);
 	bprintf(text[SiTotalLogons],ultoac(stats.logons,tmp));
 	bprintf(text[SiLogonsToday],ultoac(stats.ltoday,tmp));
 	bprintf(text[SiTotalTime],ultoac(stats.timeon,tmp));
 	bprintf(text[SiTimeToday],ultoac(stats.ttoday,tmp));
 	ver();
-	if(yesno(text[ViewSysInfoFileQ])) {
+	if(text[ViewSysInfoFileQ][0] && yesno(text[ViewSysInfoFileQ])) {
 		CLS;
 		sprintf(tmp,"%ssystem.msg", cfg.text_dir);
 		printfile(tmp,0); 
 	}
-	if(yesno(text[ViewLogonMsgQ])) {
+	if(text[ViewLogonMsgQ][0] && yesno(text[ViewLogonMsgQ])) {
 		CLS;
 		menu("logon"); 
 	}
diff --git a/src/sbbs3/writemsg.cpp b/src/sbbs3/writemsg.cpp
index d348a795d2..0419eb1ace 100644
--- a/src/sbbs3/writemsg.cpp
+++ b/src/sbbs3/writemsg.cpp
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -891,7 +891,7 @@ ulong sbbs_t::msgeditor(char *buf, const char *top, char *title)
 			else if(toupper(strin[1])=='L') {   /* list message */
 				if(line==lines)
 					free(str[line]);
-				if(lines)
+				if(lines && text[WithLineNumbersQ][0])
 					i=!noyes(text[WithLineNumbersQ]);
 				else
 					i=0;
-- 
GitLab