From 2c1861258993e6fcf1af6ab60c3fd286c0e3133b Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 25 Oct 2005 20:29:56 +0000
Subject: [PATCH] Reset outchar_esc to 0 as soon as last ANSI sequence char is
 sent. Back out last putmsg change as outchar_esc now means what it was
 intended to mean (ie: outchar is in an ESC sequence)

---
 src/sbbs3/con_out.cpp | 2 ++
 src/sbbs3/putmsg.cpp  | 5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/con_out.cpp b/src/sbbs3/con_out.cpp
index 440217d9af..4e73837aba 100644
--- a/src/sbbs3/con_out.cpp
+++ b/src/sbbs3/con_out.cpp
@@ -273,6 +273,8 @@ void sbbs_t::outchar(char ch)
 		if(lbuflen<LINE_BUFSIZE)
 			lbuf[lbuflen++]=ch; 
 	}
+	if(outchar_esc==3)
+		outchar_esc=0;
 
 	if(lncntr==rows-1 && ((useron.misc&UPAUSE) || sys_status&SS_PAUSEON) 
 		&& !(sys_status&SS_PAUSEOFF)) {
diff --git a/src/sbbs3/putmsg.cpp b/src/sbbs3/putmsg.cpp
index dd0bfa0ac6..c71e218b1f 100644
--- a/src/sbbs3/putmsg.cpp
+++ b/src/sbbs3/putmsg.cpp
@@ -221,8 +221,7 @@ char sbbs_t::putmsg(char *str, long mode)
 			}
 
 			/* ansi escape sequence */
-			if(outchar_esc && outchar_esc < 3) {	/* When outchar_esc is 3, the last char outputted
-													 * was the last char of the ANSI sequence */
+			if(outchar_esc) {
 				if(str[l]=='A' || str[l]=='B' || str[l]=='H' || str[l]=='J'
 					|| str[l]=='f' || str[l]=='u')    /* ANSI anim */
 					lncntr=0;			/* so defeat pause */
@@ -243,7 +242,7 @@ char sbbs_t::putmsg(char *str, long mode)
 			}
 			if(str[l]!=CTRL_Z) {
 				outchar(str[l]);
-				if(!exatr && (outchar_esc==0 || outchar_esc==3) && lncntr && lbuflen && cols && ++col==cols)
+				if(!exatr && !outchar_esc && lncntr && lbuflen && cols && ++col==cols)
 					lncntr++;
 				else
 					col=0;
-- 
GitLab