ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/mon/src/mon.cpp
(Generate patch)

Comparing mon/src/mon.cpp (file contents):
Revision 1.20 by gbeauche, 2002-09-07T12:48:15Z vs.
Revision 1.22 by cebix, 2003-09-27T20:33:06Z

# Line 1 | Line 1
1   /*
2   *  mon.cpp - cxmon main program
3   *
4 < *  cxmon (C) 1997-2002 Christian Bauer, Marc Hellwig
4 > *  cxmon (C) 1997-2003 Christian Bauer, Marc Hellwig
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 267 | Line 267 | static void read_line(char *prompt)
267  
268          line_read = readline(prompt);
269  
270 <        if (line_read && *line_read)
271 <                add_history(line_read);
270 >        if (line_read) {
271 >
272 >                if (*line_read)
273 >                        add_history(line_read);
274 >
275 >                strncpy(in_ptr = input, line_read, INPUT_LENGTH);
276 >                input[INPUT_LENGTH-1] = 0;
277  
278 <        strncpy(in_ptr = input, line_read, INPUT_LENGTH);
279 <        input[INPUT_LENGTH-1] = 0;
278 >        } else {
279 >
280 >                // EOF, quit cxmon
281 >                fprintf(monout, "x\n");
282 >                input[0] = 'x';
283 >                input[1] = 0;
284 >                in_ptr = input;
285 >        }
286   #else
287          fprintf(monout, prompt);
288          fflush(monout);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines