add code to keep log of user input
[capablanca.git] / lasker-2.2.3 / src / command.c
index 7d440c5..2286cd6 100644 (file)
@@ -695,12 +695,17 @@ static int process_password(int p, char *password)
   return 0;
 }
 
+FILE *comlog = NULL;
+
 static int process_prompt(int p, char *command)
 {
   struct player *pp = &player_globals.parray[p];
   int retval;
   char *cmd = "";
 
+       if(comlog == NULL) comlog = fopen("command.log", "a");
+       if(comlog) fprintf(comlog, "p%d: '%s'\n", p, command), fflush(comlog);
+
   command = eattailwhite(eatwhite(command));
   if (!*command) {
          send_prompt(p);