From 2e40bf9bffe8100de14bf4be9b21db2d2c2cbdd6 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 2 Dec 2012 12:26:24 +0100 Subject: [PATCH] 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 --- src/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index e47a7ded3..1ade240b4 100644 --- a/src/main.c +++ b/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 */