From 730cbdad7dd70484bcdec2e6594cb0565e6116a9 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Sat, 4 May 2013 21:37:28 +0000
Subject: [PATCH] Always fail request_telnet_opt() immediately when not using
 telnet.

Prevents telnet options from getting set incorrectly.
---
 src/sbbs3/main.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 41ef5e5839..29e7bc4921 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -1488,6 +1488,9 @@ void sbbs_t::send_telnet_cmd(uchar cmd, uchar opt)
 
 bool sbbs_t::request_telnet_opt(uchar cmd, uchar opt, unsigned waitforack)
 {
+	if(telnet_mode&TELNET_MODE_OFF)	
+		return false;
+
 	if(cmd==TELNET_DO || cmd==TELNET_DONT) {	/* remote option */
 		if(telnet_remote_option[opt]==telnet_opt_ack(cmd))
 			return true;	/* already set in this mode, do nothing */
-- 
GitLab