--- mon/src/mon.cpp 2002/09/07 12:48:15 1.20 +++ mon/src/mon.cpp 2003/09/27 20:30:44 1.21 @@ -267,11 +267,22 @@ static void read_line(char *prompt) line_read = readline(prompt); - if (line_read && *line_read) - add_history(line_read); + if (line_read) { - strncpy(in_ptr = input, line_read, INPUT_LENGTH); - input[INPUT_LENGTH-1] = 0; + if (*line_read) + add_history(line_read); + + strncpy(in_ptr = input, line_read, INPUT_LENGTH); + input[INPUT_LENGTH-1] = 0; + + } else { + + // EOF, quit cxmon + fprintf(monout, "x\n"); + input[0] = 'x'; + input[1] = 0; + in_ptr = input; + } #else fprintf(monout, prompt); fflush(monout);