diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-04-18 12:36:02 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-04-18 14:59:03 +0300 |
commit | 2c0f7b54ad8e820ec357c2cad08b8d31fa601ead (patch) | |
tree | a9a3d4a4644d8346291bedcdbe39cd69cf3bc445 /rpmio/argv.c | |
parent | 8058de50b24f548df74df0943cb3a29c77fbde61 (diff) | |
download | rpm-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.c | 12 |
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; +} + |