]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Correctly display a message if a command could not be found.
authorJason Parker <jparker@digium.com>
Wed, 9 Jan 2008 20:28:43 +0000 (20:28 +0000)
committerJason Parker <jparker@digium.com>
Wed, 9 Jan 2008 20:28:43 +0000 (20:28 +0000)
Also fix a comment which may have led to this happening.

Issue 11718, reported by kshumard.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97622 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/cli.c

index eee61b5cd87c619d66d5e718e209e442389f2e6d..2ecf20a3dea1e6366b579d144ce89cdf824ca61c 100644 (file)
@@ -1724,10 +1724,9 @@ void ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
 }
 
 
-/*! \brief helper for help_workhorse and final part of
- * handle_help. if locked = 0 it's just help_workhorse,
- * otherwise assume the list is already locked and print
- * an error message if not found.
+/*! \brief helper for help_workhorse and final part of handle_help
+ * if locked = 0 it's just help_workhorse, otherwise assume the
+ * list is already locked.
  */
 static int help1(int fd, char *match[], int locked)
 {
@@ -1757,7 +1756,7 @@ static int help1(int fd, char *match[], int locked)
        }
        if (!locked)
                AST_LIST_UNLOCK(&helpers);
-       if (!locked && !found && matchstr[0])
+       if (!found && matchstr[0])
                ast_cli(fd, "No such command '%s'.\n", matchstr);
        return RESULT_SUCCESS;
 }