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:
rlar 2012-12-02 12:26:24 +01:00
parent 6260fd16ec
commit 2e40bf9bff
1 changed files with 9 additions and 2 deletions

View File

@ -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 */