summaryrefslogtreecommitdiff
path: root/lib/sh/stringvec.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sh/stringvec.c')
-rw-r--r--lib/sh/stringvec.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/sh/stringvec.c b/lib/sh/stringvec.c
index b0ed4164..3bb4ab70 100644
--- a/lib/sh/stringvec.c
+++ b/lib/sh/stringvec.c
@@ -40,6 +40,14 @@ strvec_create (n)
return ((char **)xmalloc ((n) * sizeof (char *)));
}
+/* Allocate an array of strings with room for N members. */
+char **
+strvec_mcreate (n)
+ int n;
+{
+ return ((char **)malloc ((n) * sizeof (char *)));
+}
+
char **
strvec_resize (array, nsize)
char **array;
@@ -48,6 +56,14 @@ strvec_resize (array, nsize)
return ((char **)xrealloc (array, nsize * sizeof (char *)));
}
+char **
+strvec_mresize (array, nsize)
+ char **array;
+ int nsize;
+{
+ return ((char **)realloc (array, nsize * sizeof (char *)));
+}
+
/* Return the length of ARRAY, a NULL terminated array of char *. */
int
strvec_len (array)