Do not save ICS password in command history
[xboard.git] / dialogs.c
index 3279a5f..50f40b1 100644 (file)
--- 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,6 +2158,23 @@ ConsoleAutoPopUp (char *buf)
        } else PopUpMoveDialog(*buf);
 }
 
+void
+EchoOn ()
+{
+    if(!noEcho) return;
+    system("stty echo");
+    WidgetEcho(&chatOptions[CHAT_IN], 1);
+    noEcho = False;
+}
+
+void
+EchoOff ()
+{
+    system("stty -echo");
+    WidgetEcho(&chatOptions[CHAT_IN], 0);
+    noEcho = True;
+}
+
 //--------------------------------- Game-List options dialog ------------------------------------------
 
 char *strings[LPUSERGLT_SIZE];
@@ -2443,7 +2462,7 @@ GetHelpText (FILE *f, char *name)
     int len, cnt = 0;
     snprintf(buf, MSG_SIZ, ".B %s", name);
     len = strlen(buf);
-    for(len=1; buf[len] == ' ' || isalpha(buf[len]) || isdigit(buf[len]); len++);
+    for(len=1; buf[len] == ' ' || buf[len] == '-' || isalpha(buf[len]) || isdigit(buf[len]); len++);
     buf[len] = NULLCHAR;
     while(buf[--len] == ' ') buf[len] = NULLCHAR;
     while((line = ReadLine(f))) {
@@ -2460,7 +2479,7 @@ GetHelpText (FILE *f, char *name)
                if(p - text > 9900) break;
            }
            *p = NULLCHAR;
-           DisplayNote(text);
+           ErrorPopUp("Help", text, FALSE);
            return;
        }
     }
@@ -2873,6 +2892,7 @@ static char *Extensions[] = {
 ".trn",
 ".bin",
 ".wav",
+".png",
 ".ini",
 ".log",
 "",