From e6720be078d4194cda4148803a3725e34ecb1345 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 12 Mar 2009 10:01:07 -0700 Subject: [PATCH] svec: Add new argument to svec_join(). --- lib/svec.c | 4 +++- lib/svec.h | 3 ++- vswitchd/bridge.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/svec.c b/lib/svec.c index 2d9ddf98..e0489304 100644 --- a/lib/svec.c +++ b/lib/svec.c @@ -353,7 +353,8 @@ svec_equal(const struct svec *a, const struct svec *b) } char * -svec_join(const struct svec *svec, const char *delimiter) +svec_join(const struct svec *svec, + const char *delimiter, const char *terminator) { struct ds ds; size_t i; @@ -365,6 +366,7 @@ svec_join(const struct svec *svec, const char *delimiter) } ds_put_cstr(&ds, svec->names[i]); } + ds_put_cstr(&ds, terminator); return ds_cstr(&ds); } diff --git a/lib/svec.h b/lib/svec.h index c9c42c8d..0af162d9 100644 --- a/lib/svec.h +++ b/lib/svec.h @@ -68,7 +68,8 @@ void svec_swap(struct svec *a, struct svec *b); void svec_print(const struct svec *svec, const char *title); void svec_parse_words(struct svec *svec, const char *words); bool svec_equal(const struct svec *, const struct svec *); -char *svec_join(const struct svec *, const char *delimiter); +char *svec_join(const struct svec *, + const char *delimiter, const char *terminator); const char *svec_back(const struct svec *); void svec_pop_back(struct svec *); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 5f01afec..0cc1e154 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -920,7 +920,7 @@ bridge_reconfigure_one(struct bridge *br) svec_init(&command_acls); cfg_get_all_strings(&command_acls, "%s.commands.acl", pfx); - command_acl = svec_join(&command_acls, ","); + command_acl = svec_join(&command_acls, ",", ""); ofproto_set_remote_execution(br->ofproto, command_acl, cfg_get_string(0, "%s.commands.dir", -- 2.30.2