[asterisk-commits] qwell: trunk r82125 - /trunk/main/db.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 10 11:24:30 CDT 2007


Author: qwell
Date: Mon Sep 10 11:24:29 2007
New Revision: 82125

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82125
Log:
Add counter to 'database show' CLI command.
(also a minor whitespace change that I found along the way)

Closes issue #10683, patch by junky

Modified:
    trunk/main/db.c

Modified: trunk/main/db.c
URL: http://svn.digium.com/view/asterisk/trunk/main/db.c?view=diff&rev=82125&r1=82124&r2=82125
==============================================================================
--- trunk/main/db.c (original)
+++ trunk/main/db.c Mon Sep 10 11:24:29 2007
@@ -306,6 +306,7 @@
 	char *keys, *values;
 	int res;
 	int pass;
+	int counter = 0;
 
 	if (argc == 4) {
 		/* Family and key tree */
@@ -342,10 +343,12 @@
 			values = "<bad value>";
 		}
 		if (keymatch(keys, prefix)) {
-				ast_cli(fd, "%-50s: %-25s\n", keys, values);
+			ast_cli(fd, "%-50s: %-25s\n", keys, values);
+			counter++;
 		}
 	}
 	ast_mutex_unlock(&dblock);
+	ast_cli(fd, "%d results found.\n", counter);
 	return RESULT_SUCCESS;	
 }
 
@@ -387,8 +390,8 @@
 			values = "<bad value>";
 		}
 		if (subkeymatch(keys, suffix)) {
-				ast_cli(fd, "%-50s: %-25s\n", keys, values);
-				counter++;
+			ast_cli(fd, "%-50s: %-25s\n", keys, values);
+			counter++;
 		}
 	}
 	ast_mutex_unlock(&dblock);




More information about the asterisk-commits mailing list