From a38553bd0e0c5277dbff1834c63e54ef5430a9d5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 4 Mar 2009 09:57:01 -0800 Subject: [PATCH] New function svec_clone(). --- lib/svec.c | 7 +++++++ lib/svec.h | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/svec.c b/lib/svec.c index e2ac25d3..bbf4b353 100644 --- a/lib/svec.c +++ b/lib/svec.c @@ -51,6 +51,13 @@ svec_init(struct svec *svec) svec->allocated = 0; } +void +svec_clone(struct svec *svec, const struct svec *other) +{ + svec_init(svec); + svec_append(svec, other); +} + void svec_destroy(struct svec *svec) { diff --git a/lib/svec.h b/lib/svec.h index 0cd21922..542e8687 100644 --- a/lib/svec.h +++ b/lib/svec.h @@ -46,6 +46,7 @@ struct svec { #define SVEC_EMPTY_INITIALIZER { NULL, 0, 0 } void svec_init(struct svec *); +void svec_clone(struct svec *, const struct svec *); void svec_destroy(struct svec *); void svec_clear(struct svec *); void svec_add(struct svec *, const char *); -- 2.30.2