allow Ctrl-d to quit
based upon Cody Creagers patch, EOF Control-D support - ID: 3586069 http://sourceforge.net/tracker/?func=detail&aid=3586069&group_id=38962&atid=423917
This commit is contained in:
parent
6260fd16ec
commit
2e40bf9bff
11
src/main.c
11
src/main.c
|
|
@ -627,7 +627,13 @@ app_rl_readlines(void)
|
|||
SETJMP(jbuf, 1); /* Set location to jump to after handling SIGINT (ctrl-C) */
|
||||
|
||||
line = readline(prompt());
|
||||
if (line && *line) {
|
||||
|
||||
if (!line) {
|
||||
cp_evloop("quit");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*line) {
|
||||
int s = history_expand(line, &expanded_line);
|
||||
|
||||
if (s == 2) {
|
||||
|
|
@ -640,7 +646,8 @@ app_rl_readlines(void)
|
|||
}
|
||||
free(expanded_line);
|
||||
}
|
||||
if (line) free(line);
|
||||
|
||||
free(line);
|
||||
}
|
||||
/* History gets written in ../fte/misccoms.c com_quit */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue