[Asterisk-cvs] asterisk cli.c,1.53.2.6,1.53.2.7

russell at lists.digium.com russell at lists.digium.com
Tue May 24 06:24:56 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv24459

Modified Files:
      Tag: v1-0
	cli.c 
Log Message:
fix output when no help text is available for a cli command
fix a seg fault when astmm is enabled (bug #4356)


Index: cli.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cli.c,v
retrieving revision 1.53.2.6
retrieving revision 1.53.2.7
diff -u -d -r1.53.2.6 -r1.53.2.7
--- cli.c	30 Dec 2004 22:30:09 -0000	1.53.2.6
+++ cli.c	24 May 2005 10:29:12 -0000	1.53.2.7
@@ -918,9 +918,14 @@
 		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 {




More information about the svn-commits mailing list