aboutsummaryrefslogtreecommitdiffstats
path: root/cli.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-24 10:23:51 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-24 10:23:51 +0000
commit4c6cb8a9b80e3d5e4256c50e2740cafd2fe226b1 (patch)
tree5cf97cd4ec3eb5170b162d62e12ac34dd9e107cb /cli.c
parent9e0de68a9fac0ce5464bbd98a28abd0cedf1bd2f (diff)
print out appropriate message when no help text is available for a command
fix a seg fault when astmm is enabled (bug #4356) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5758 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cli.c')
-rwxr-xr-xcli.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cli.c b/cli.c
index 80150eefe..b61b5898c 100755
--- a/cli.c
+++ b/cli.c
@@ -1065,9 +1065,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 {