projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d18519a
)
Quit when "exit" or "quit" commands are used in tincctl's shell.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 5 Aug 2012 15:25:31 +0000
(17:25 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 5 Aug 2012 15:25:31 +0000
(17:25 +0200)
src/tincctl.c
patch
|
blob
|
history
diff --git
a/src/tincctl.c
b/src/tincctl.c
index f384dd756be84bd3545f61158d504515e4e51d30..fa5253371a548e5473193ba92e184d5454b0f8a0 100644
(file)
--- 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