]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
cli: reset terminal when CTRL+d is pressed
authorEric Leblond <eric@regit.org>
Sun, 2 Jun 2013 10:18:03 +0000 (12:18 +0200)
committerEric Leblond <eric@regit.org>
Sat, 8 Jun 2013 10:06:22 +0000 (12:06 +0200)
The terminal was not correctly resetted when CTRL+d was pressed.
The result was that reset has to be called from shell after exit.

src/cli.c

index 541c26cafa8d0add362296f68b76f9bd23a8ff27..8875207d4c5977f9f55ff3ad9bf597ff4770cd02 100644 (file)
--- 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))