From: Guus Sliepen Date: Sun, 5 Aug 2012 15:25:31 +0000 (+0200) Subject: Quit when "exit" or "quit" commands are used in tincctl's shell. X-Git-Tag: release-1.1pre3~58 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=5567c0d4107e6ff6f4639d8664651841bd59ddad;p=tinc Quit when "exit" or "quit" commands are used in tincctl's shell. --- diff --git a/src/tincctl.c b/src/tincctl.c index f384dd75..fa525337 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1951,6 +1951,9 @@ static int cmd_shell(int argc, char *argv[]) { if(nargc == argc) continue; + if(!strcasecmp(nargv[argc], "exit") || !strcasecmp(nargv[argc], "quit")) + return result; + bool found = false; for(int i = 0; commands[i].command; i++) { @@ -1962,7 +1965,7 @@ static int cmd_shell(int argc, char *argv[]) { } #ifdef HAVE_READLINE - if(found) + if(tty && found) add_history(copy); #endif