From 178d154799bcf29e9f98cad87a725f22cad20d6e Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 25 Jun 2002 10:44:35 +0000
Subject: [PATCH] Created new SBBSecho toggle option: Strip Line Feeds From
 Outgoing Messages (used to always do this, but some non-conforming echomail
 programs apparently treat sole-carriage returns as soft-CRs and ignore/strip
 them).

---
 src/sbbs3/echocfg.c  | 12 +++++++++++-
 src/sbbs3/rechocfg.c |  4 ++--
 src/sbbs3/sbbsecho.c |  8 +++-----
 src/sbbs3/sbbsecho.h |  2 +-
 4 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/sbbs3/echocfg.c b/src/sbbs3/echocfg.c
index b74a912cb6..a1d715927f 100644
--- a/src/sbbs3/echocfg.c
+++ b/src/sbbs3/echocfg.c
@@ -693,6 +693,8 @@ int main(int argc, char **argv)
 						"in Message Base",misc&STORE_KLUDGE ? "Yes":"No");
 					sprintf(opt[i++],"%-50.50s%-3.3s","Allow Nodes to Add Areas "
 						"in the AREAS.BBS List",misc&ELIST_ONLY?"No":"Yes");
+					sprintf(opt[i++],"%-50.50s%-3.3s","Strip Line Feeds "
+						"From Outgoing Messages",misc&STRIP_LF ? "Yes":"No");
 					sprintf(opt[i++],"%-50.50s%-3.3s","Kill/Ignore Empty NetMail "
 						"Messages",misc&KILL_EMPTY_MAIL ? "Yes":"No");
 					opt[i][0]=0;
@@ -725,8 +727,13 @@ int main(int argc, char **argv)
 							misc^=ELIST_ONLY;
 							break;
 						case 7:
+							misc^=STRIP_LF;
+							break;
+						case 8:
 							misc^=KILL_EMPTY_MAIL;
-							} }
+							break;
+					} 
+				}
 				break;
 			case 8:
 	uifc.helpbuf=
@@ -1050,6 +1057,9 @@ int main(int argc, char **argv)
 					fprintf(stream,"FLO_MAILER\n");
 				if(misc&ELIST_ONLY)
 					fprintf(stream,"ELIST_ONLY\n");
+				if(misc&STRIP_LF)
+					fprintf(stream,"STRIP_LF\n");
+
 				if(cfg.areafile[0])
 					fprintf(stream,"AREAFILE %s\n",cfg.areafile);
 				if(cfg.logfile[0])
diff --git a/src/sbbs3/rechocfg.c b/src/sbbs3/rechocfg.c
index ef8d84fa06..141695f3eb 100644
--- a/src/sbbs3/rechocfg.c
+++ b/src/sbbs3/rechocfg.c
@@ -287,8 +287,8 @@ void read_echo_cfg()
 			misc|=SECURE;
 			continue; }
 
-		if(!stricmp(tmp,"CHECKMEM")) {
-			misc|=CHECKMEM;
+		if(!stricmp(tmp,"STRIP_LF")) {
+			misc|=STRIP_LF;
 			continue; }
 
 		if(!stricmp(tmp,"STORE_SEENBY")) {
diff --git a/src/sbbs3/sbbsecho.c b/src/sbbs3/sbbsecho.c
index dc5918fd15..8ac17a0c14 100644
--- a/src/sbbs3/sbbsecho.c
+++ b/src/sbbs3/sbbsecho.c
@@ -3675,8 +3675,10 @@ void export_echomail(char *sub_code,faddr_t addr)
 						if(!buf[l])
 							break;
 						continue; }
-					if(buf[l]==LF)	/* Ignore line feeds */
+					
+					if(misc&STRIP_LF && buf[l]==LF)	/* Ignore line feeds */
 						continue;
+
 					if(cr) {
 						if(buf[l]=='-' && buf[l+1]=='-'
 							&& buf[l+2]=='-'
@@ -4267,10 +4269,6 @@ int main(int argc, char **argv)
 			if(fmsgbuf) {
 				FREE(fmsgbuf);
 				fmsgbuf=0; }
-#if 0
-			if(misc&CHECKMEM)
-				checkmem();
-#endif
 			if(!fread(&ch,1,1,fidomsg)) 		 /* Message type (0200h) */
 				break;
 			if(ch!=02)
diff --git a/src/sbbs3/sbbsecho.h b/src/sbbs3/sbbsecho.h
index af06de9d80..6f71490bd9 100644
--- a/src/sbbs3/sbbsecho.h
+++ b/src/sbbs3/sbbsecho.h
@@ -18,7 +18,7 @@
 #define IGNORE_MSGPTRS	(1L<<9)
 #define UPDATE_MSGPTRS	(1L<<10)
 #define LEAVE_MSGPTRS	(1L<<11)
-#define CHECKMEM		(1L<<12)		/* Display available memory */
+#define STRIP_LF		(1L<<12)		/* Stripl line-feeds from outgoing messages */
 #define ASCII_ONLY		(1L<<13)
 #define LOGFILE 		(1L<<14)
 #define REPORT			(1L<<15)
-- 
GitLab