fix the 'agi show commands' CLI function.

(closes issue #13666)
Reported by: eliel
Patches: 
      res_agi.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Michiel van Baak 2008-10-12 09:19:23 +00:00
parent 399d82541a
commit 1097de1382
1 changed files with 2 additions and 2 deletions

View File

@ -2740,9 +2740,9 @@ static char *handle_cli_agi_show(struct ast_cli_entry *e, int cmd, struct ast_cl
case CLI_GENERATE:
return NULL;
}
if (a->argc < e->args)
if (a->argc < e->args - 1 || (a->argc >= e->args && strcasecmp(a->argv[e->args - 1], "topic")))
return CLI_SHOWUSAGE;
if (a->argc > e->args) {
if (a->argc > e->args - 1) {
command = find_command(a->argv + e->args, 1);
if (command) {
ast_cli(a->fd, "%s", command->usage);