From a42433dc1ce1636caf1b6a1e95aa819200a349eb Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 13 Feb 2014 00:04:01 +0000
Subject: [PATCH] Bug-fix: console.clearkeybuffer() only removed keys which
 were manually placed in the keyboard buffer (e.g. via console.ungetstr()) and
 not any keys (bytes) which had been received from the remote terminal. Now
 this method will clear both the "keybuf" (used for ungetkey/ungetstr keys)
 and the receive byte buffer (sbbs.inbuf).

---
 src/sbbs3/js_console.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/js_console.cpp b/src/sbbs3/js_console.cpp
index 4aea2615b8..7a62127190 100644
--- a/src/sbbs3/js_console.cpp
+++ b/src/sbbs3/js_console.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 2013 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2014 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				*
@@ -1598,6 +1598,7 @@ js_clearkeybuf(JSContext *cx, uintN argc, jsval *arglist)
 		return(JS_FALSE);
 
 	sbbs->keybufbot=sbbs->keybuftop=0;
+	RingBufReInit(&sbbs->inbuf);
     return(JS_TRUE);
 }
 
-- 
GitLab