Quit when "exit" or "quit" commands are used in tincctl's shell.
This commit is contained in:
parent
d18519ae21
commit
5567c0d410
1 changed files with 4 additions and 1 deletions
|
@ -1951,6 +1951,9 @@ static int cmd_shell(int argc, char *argv[]) {
|
||||||
if(nargc == argc)
|
if(nargc == argc)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if(!strcasecmp(nargv[argc], "exit") || !strcasecmp(nargv[argc], "quit"))
|
||||||
|
return result;
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
for(int i = 0; commands[i].command; i++) {
|
for(int i = 0; commands[i].command; i++) {
|
||||||
|
@ -1962,7 +1965,7 @@ static int cmd_shell(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_READLINE
|
#ifdef HAVE_READLINE
|
||||||
if(found)
|
if(tty && found)
|
||||||
add_history(copy);
|
add_history(copy);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue