[asterisk-commits] twilson: trunk r224074 - /trunk/res/res_calendar.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 14 16:17:01 CDT 2009


Author: twilson
Date: Wed Oct 14 16:16:57 2009
New Revision: 224074

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=224074
Log:
Add missing 'getnum' field

Modified:
    trunk/res/res_calendar.c

Modified: trunk/res/res_calendar.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_calendar.c?view=diff&rev=224074&r1=224073&r2=224074
==============================================================================
--- trunk/res/res_calendar.c (original)
+++ trunk/res/res_calendar.c Wed Oct 14 16:16:57 2009
@@ -1171,6 +1171,7 @@
 	struct eventlist *events;
 	struct evententry *entry;
 	int row = 1;
+	size_t listlen = 0;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(id);
 		AST_APP_ARG(field);
@@ -1204,6 +1205,15 @@
 
 	if (!ast_strlen_zero(args.row)) {
 		row = atoi(args.row);
+	}
+
+	AST_LIST_TRAVERSE(events, entry, list) {
+		listlen++;
+	}
+
+	if (!strcasecmp(args.field, "getnum")) {
+		snprintf(buf, len, "%zu", listlen);
+		return 0;
 	}
 
 	AST_LIST_TRAVERSE(events, entry, list) {




More information about the asterisk-commits mailing list