diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-09-04 03:55:41 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-09-04 03:55:41 +0000 |
commit | 69fe11fa291bac1e37906032f627f12db58de852 (patch) | |
tree | e612bc6a94e7570dccde9134299b3ed38d52bc73 /asterisk.c | |
parent | 66bf07d3cbacf10c9e853c2f4f166881d355a15b (diff) |
Better handling of quit/exit (bug #218)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1468 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-x | asterisk.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/asterisk.c b/asterisk.c index 2b3f498de..1689e54fc 100755 --- a/asterisk.c +++ b/asterisk.c @@ -579,15 +579,12 @@ static int remoteconsolehandler(char *s) system(getenv("SHELL") ? getenv("SHELL") : "/bin/sh"); ret = 1; } - if (!strcasecmp(s, "help")) { + if (strncasecmp(s, "help", 4) == 0 && (s[4] == '\0' || isspace(s[4]))) { fprintf(stdout, " !<command> Executes a given shell command\n"); ret = 0; } - if (!strcasecmp(s, "quit")) { - quit_handler(0, 0, 0, 0); - ret = 1; - } - if (!strcasecmp(s, "exit")) { + if ((strncasecmp(s, "quit", 4) == 0 || strncasecmp(s, "exit", 4) == 0) && + (s[4] == '\0' || isspace(s[4]))) { quit_handler(0, 0, 0, 0); ret = 1; } @@ -889,7 +886,7 @@ static char *cli_complete(EditLine *el, int ch) LineInfo *lf = (LineInfo *)el_line(el); - *lf->cursor = '\0'; + *(char *)lf->cursor = '\0'; ptr = (char *)lf->cursor; if (ptr) { while (ptr > lf->buffer) { |