mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-21 12:30:41 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@5758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
11
cli.c
11
cli.c
@@ -1065,9 +1065,14 @@ static int handle_help(int fd, int argc, char *argv[]) {
|
|||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
e = find_cli(argv + 1, 1);
|
e = find_cli(argv + 1, 1);
|
||||||
if (e)
|
if (e) {
|
||||||
ast_cli(fd, e->usage);
|
if (e->usage)
|
||||||
else {
|
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)) {
|
if (find_cli(argv + 1, -1)) {
|
||||||
return help_workhorse(fd, argv + 1);
|
return help_workhorse(fd, argv + 1);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user