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.21 by cebix, 2003-09-27T20:30:44Z

# 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 <        strncpy(in_ptr = input, line_read, INPUT_LENGTH);
273 <        input[INPUT_LENGTH-1] = 0;
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 >        } 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