summaryrefslogtreecommitdiff
path: root/rpmio/argv.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-18 12:36:02 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-18 14:59:03 +0300
commit2c0f7b54ad8e820ec357c2cad08b8d31fa601ead (patch)
treea9a3d4a4644d8346291bedcdbe39cd69cf3bc445 /rpmio/argv.c
parent8058de50b24f548df74df0943cb3a29c77fbde61 (diff)
downloadrpm-2c0f7b54ad8e820ec357c2cad08b8d31fa601ead.tar.gz
rpm-2c0f7b54ad8e820ec357c2cad08b8d31fa601ead.tar.bz2
rpm-2c0f7b54ad8e820ec357c2cad08b8d31fa601ead.zip
Add argvJoin() for combining an argv array into a string
Diffstat (limited to 'rpmio/argv.c')
-rw-r--r--rpmio/argv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/rpmio/argv.c b/rpmio/argv.c
index 0ff05acf0..ff11f5c4a 100644
--- a/rpmio/argv.c
+++ b/rpmio/argv.c
@@ -197,3 +197,15 @@ int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
*argvp = argv;
return 0;
}
+
+char *argvJoin(ARGV_const_t argv, const char *sep)
+{
+ char *dest = NULL;
+ char * const *arg;
+
+ for (arg = argv; *arg; arg++) {
+ rstrscat(&dest, *arg, *(arg+1) ? sep : "", NULL);
+ }
+ return dest;
+}
+