diff options
Diffstat (limited to 'argv-array.c')
-rw-r--r-- | argv-array.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/argv-array.c b/argv-array.c index 9e960d549c..eaed47712b 100644 --- a/argv-array.c +++ b/argv-array.c @@ -49,6 +49,12 @@ void argv_array_pushl(struct argv_array *array, ...) va_end(ap); } +void argv_array_pushv(struct argv_array *array, const char **argv) +{ + for (; *argv; argv++) + argv_array_push(array, *argv); +} + void argv_array_pop(struct argv_array *array) { if (!array->argc) @@ -68,23 +74,3 @@ void argv_array_clear(struct argv_array *array) } argv_array_init(array); } - -const char **argv_array_detach(struct argv_array *array, int *argc) -{ - const char **argv = - array->argv == empty_argv || array->argc == 0 ? NULL : array->argv; - if (argc) - *argc = array->argc; - argv_array_init(array); - return argv; -} - -void argv_array_free_detached(const char **argv) -{ - if (argv) { - int i; - for (i = 0; argv[i]; i++) - free((char **)argv[i]); - free(argv); - } -} |