[asterisk-commits] trunk r25860 - /trunk/cli.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 8 23:14:31 MST 2006


Author: rizzo
Date: Tue May  9 01:14:30 2006
New Revision: 25860

URL: http://svn.digium.com/view/asterisk?rev=25860&view=rev
Log:
use S_OR where appropriate, comment an unclear difference in format
between CONCISE and VERBOSE


Modified:
    trunk/cli.c

Modified: trunk/cli.c
URL: http://svn.digium.com/view/asterisk/trunk/cli.c?rev=25860&r1=25859&r2=25860&view=diff
==============================================================================
--- trunk/cli.c (original)
+++ trunk/cli.c Tue May  9 01:14:30 2006
@@ -422,15 +422,21 @@
 		}
 		if (concise) {
 			ast_cli(fd, CONCISE_FORMAT_STRING, c->name, c->context, c->exten, c->priority, ast_state2str(c->_state),
-			        c->appl ? c->appl : "(None)", c->data ? c->data : "",
+			        c->appl ? c->appl : "(None)",
+				S_OR(c->data, ""),	/* XXX different from verbose ? */
 			        S_OR(c->cid.cid_num, ""),
-			        c->accountcode ? c->accountcode : "", c->amaflags, 
-			        durbuf, bc ? bc->name : "(None)");
+			        S_OR(c->accountcode, ""),
+				c->amaflags, 
+			        durbuf,
+				bc ? bc->name : "(None)");
 		} else if (verbose) {
 			ast_cli(fd, VERBOSE_FORMAT_STRING, c->name, c->context, c->exten, c->priority, ast_state2str(c->_state),
-			        c->appl ? c->appl : "(None)", c->data ? S_OR(c->data, "(Empty)" ): "(None)",
-			        S_OR(c->cid.cid_num, ""), durbuf,
-			        c->accountcode ? c->accountcode : "", bc ? bc->name : "(None)");
+			        c->appl ? c->appl : "(None)",
+				c->data ? S_OR(c->data, "(Empty)" ): "(None)",
+			        S_OR(c->cid.cid_num, ""),
+				durbuf,
+			        S_OR(c->accountcode, ""),
+				bc ? bc->name : "(None)");
 		} else {
 			if (!ast_strlen_zero(c->context) && !ast_strlen_zero(c->exten)) 
 				snprintf(locbuf, sizeof(locbuf), "%s@%s:%d", c->exten, c->context, c->priority);



More information about the asterisk-commits mailing list