summaryrefslogtreecommitdiff
path: root/argv-array.c
diff options
context:
space:
mode:
Diffstat (limited to 'argv-array.c')
-rw-r--r--argv-array.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/argv-array.c b/argv-array.c
index 0b5f8898a1..55e8443ff9 100644
--- a/argv-array.c
+++ b/argv-array.c
@@ -49,6 +49,15 @@ void argv_array_pushl(struct argv_array *array, ...)
va_end(ap);
}
+void argv_array_pop(struct argv_array *array)
+{
+ if (!array->argc)
+ return;
+ free((char *)array->argv[array->argc - 1]);
+ array->argv[array->argc - 1] = NULL;
+ array->argc--;
+}
+
void argv_array_clear(struct argv_array *array)
{
if (array->argv != empty_argv) {