]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix output when no help text is available for a cli command
authorRussell Bryant <russell@russellbryant.com>
Tue, 24 May 2005 10:29:12 +0000 (10:29 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 24 May 2005 10:29:12 +0000 (10:29 +0000)
fix a seg fault when astmm is enabled (bug #4356)

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

cli.c

diff --git a/cli.c b/cli.c
index f72d087f2079ac7379fcd0c1b7c42468355a1ac2..bbcd4820de98e17228b96611627f1df4224868ce 100755 (executable)
--- a/cli.c
+++ b/cli.c
@@ -918,9 +918,14 @@ static int handle_help(int fd, int argc, char *argv[]) {
                return RESULT_SHOWUSAGE;
        if (argc > 1) {
                e = find_cli(argv + 1, 1);
-               if (e) 
-                       ast_cli(fd, e->usage);
-               else {
+               if (e) {
+                       if (e->usage)
+                               ast_cli(fd, e->usage);
+                       else {
+                               join(fullcmd, sizeof(fullcmd), argv+1);
+                               ast_cli(fd, "No help text available for '%s'.\n", fullcmd);
+                       }
+               } else {
                        if (find_cli(argv + 1, -1)) {
                                return help_workhorse(fd, argv + 1);
                        } else {