From: Sean Bright Date: Fri, 3 Oct 2008 22:10:18 +0000 (+0000) Subject: Resolve a subtle bug where we would never successfully be able to get X-Git-Tag: 1.6.2.0-beta1~1210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b29fb615ae4dc5da616c3beb223b4a01f42d7238;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/trunk@146198 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/cli.c b/main/cli.c index be62352b01..784628226f 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); + } } /*!