Browse Source

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
pre-master-46
rlar 14 years ago
parent
commit
2e40bf9bff
  1. 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) */ SETJMP(jbuf, 1); /* Set location to jump to after handling SIGINT (ctrl-C) */
line = readline(prompt()); line = readline(prompt());
if (line && *line) {
if (!line) {
cp_evloop("quit");
continue;
}
if (*line) {
int s = history_expand(line, &expanded_line); int s = history_expand(line, &expanded_line);
if (s == 2) { if (s == 2) {
@ -640,7 +646,8 @@ app_rl_readlines(void)
} }
free(expanded_line); free(expanded_line);
} }
if (line) free(line);
free(line);
} }
/* History gets written in ../fte/misccoms.c com_quit */ /* History gets written in ../fte/misccoms.c com_quit */

Loading…
Cancel
Save