aboutsummaryrefslogtreecommitdiffstats
path: root/main/cli.c
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-03 22:10:18 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-03 22:10:18 +0000
commitbbd18df3cfa147725afdf33496962240c9349287 (patch)
treee16ed5c6afa1fb206427a2c644aebbeb5184dd9f /main/cli.c
parent9cc43deac5511ba1e1fd0245e26066820673440a (diff)
Resolve a subtle bug where we would never successfully be able to get
the first item in the CLI entry list. This was preventing '!' from showing up in either 'help' or in tab completion. (closes issue #13578) Reported by: mvanbaak git-svn-id: http://svn.digium.com/svn/asterisk/trunk@146198 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main/cli.c b/main/cli.c
index be62352b0..784628226 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1255,11 +1255,11 @@ void ast_builtins_init(void)
static struct ast_cli_entry *cli_next(struct ast_cli_entry *e)
{
- if (e == NULL)
- e = AST_LIST_FIRST(&helpers);
- if (e)
- e = AST_LIST_NEXT(e, list);
- return e;
+ if (e) {
+ return AST_LIST_NEXT(e, list);
+ } else {
+ return AST_LIST_FIRST(&helpers);
+ }
}
/*!