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 |
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); |