[asterisk-commits] mmichelson: branch mmichelson/rls-config r416660 - /team/mmichelson/rls-confi...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jun 18 17:46:51 CDT 2014
Author: mmichelson
Date: Wed Jun 18 17:46:48 2014
New Revision: 416660
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=416660
Log:
Allow for comma-separated list items.
Modified:
team/mmichelson/rls-config/res/res_pjsip_pubsub.c
Modified: team/mmichelson/rls-config/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/res/res_pjsip_pubsub.c?view=diff&rev=416660&r1=416659&r2=416660
==============================================================================
--- team/mmichelson/rls-config/res/res_pjsip_pubsub.c (original)
+++ team/mmichelson/rls-config/res/res_pjsip_pubsub.c Wed Jun 18 17:46:48 2014
@@ -1958,8 +1958,16 @@
struct ast_variable *var, void *obj)
{
struct resource_list *list = obj;
-
- return AST_VECTOR_APPEND(&list->items, var->value);
+ char *items = ast_strdupa(var->value);
+ char *item;
+
+ while ((item = strsep(&items, ","))) {
+ if (AST_VECTOR_APPEND(&list->items, item)) {
+ return -1;
+ }
+ }
+
+ return 0;
}
static int list_item_to_str(const void *obj, const intptr_t *args, char **buf)
More information about the asterisk-commits
mailing list