From 2a0c8134472cbaaa52ed196d851f1ba38f8c7784 Mon Sep 17 00:00:00 2001
From: H.G.Muller <hgm@hgm-xboard.(none)>
Date: Fri, 11 Mar 2016 14:25:19 +0100
Subject: [PATCH] Do not save ICS password in command history

Blanking out the password while typing it would have little effect if
the arrow keys could recall is. So we don't save any lines in the
history when echo is off.
---
 dialogs.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dialogs.c b/dialogs.c
index 9def05c..50f40b1 100644
--- a/dialogs.c
+++ b/dialogs.c
@@ -1310,10 +1310,12 @@ char *icsText;
 #define HISTORY_SIZE 64
 static char *history[HISTORY_SIZE];
 static int histIn = 0, histP = 0;
+static Boolean noEcho;
 
 static void
 SaveInHistory (char *cmd)
 {
+  if(noEcho) return; // do not save password!
   if (history[histIn] != NULL) {
     free(history[histIn]);
     history[histIn] = NULL;
@@ -2156,8 +2158,6 @@ ConsoleAutoPopUp (char *buf)
 	} else PopUpMoveDialog(*buf);
 }
 
-static Boolean noEcho;
-
 void
 EchoOn ()
 {
-- 
1.7.0.4