From: Eric Leblond Date: Sun, 2 Jun 2013 10:18:03 +0000 (+0200) Subject: cli: reset terminal when CTRL+d is pressed X-Git-Tag: v0.099~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5426ae16d828ce5e59a96dee27a0c01ddd3e8023;p=thirdparty%2Fnftables.git cli: reset terminal when CTRL+d is pressed The terminal was not correctly resetted when CTRL+d was pressed. The result was that reset has to be called from shell after exit. --- diff --git a/src/cli.c b/src/cli.c index 541c26ca..8875207d 100644 --- a/src/cli.c +++ b/src/cli.c @@ -90,8 +90,11 @@ static void cli_complete(char *line) LIST_HEAD(msgs); line = cli_append_multiline(line); - if (line == NULL) + if (line == NULL) { + printf("\n"); + cli_exit(); return; + } for (c = line; *c != '\0'; c++) if (!isspace(*c))