From bb5be11f96c98fe20dba9062634002584f0c9f83 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Mon, 6 Nov 2000 07:28:23 +0000
Subject: [PATCH] Fixed gettmplt bug introduced in last rev (template string
 must be converted to uppercase for propper parsing). Fixed ^X bug that was
 there before.

---
 src/sbbs3/str.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/sbbs3/str.cpp b/src/sbbs3/str.cpp
index 83da124061..def48719a0 100644
--- a/src/sbbs3/str.cpp
+++ b/src/sbbs3/str.cpp
@@ -435,6 +435,7 @@ uint sbbs_t::gettmplt(char *strout,char *templt, long mode)
 
 	sys_status&=~SS_ABORT;
 	sprintf(tmplt, "%.*s",sizeof(tmplt)-1, templt);
+	strupr(tmplt);
 	if(useron.misc&ANSI) {
 		if(mode&K_LINE) {
 			if(useron.misc&COLOR)
@@ -467,11 +468,12 @@ uint sbbs_t::gettmplt(char *strout,char *templt, long mode)
 			bputs(" \b");
 			continue; }
 		if(ch==24) {	/* Ctrl-X */
-			for(c--;c!=0xff;c--) {
+			for(;c;c--) {
 				outchar(BS);
-				if(tmplt[c]=='N' || tmplt[c]=='A' || tmplt[c]=='!')
-					bputs(" \b"); }
-			c=0; }
+				if(tmplt[c-1]=='N' || tmplt[c-1]=='A' || tmplt[c-1]=='!')
+					bputs(" \b"); 
+			}
+		}
 		else if(c<t) {
 			if(tmplt[c]=='N' && !isdigit(ch))
 				continue;
-- 
GitLab