summaryrefslogtreecommitdiff
path: root/lib/sh/stringvec.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2014-01-29 17:00:07 -0500
committerChet Ramey <chet.ramey@case.edu>2014-01-29 17:00:07 -0500
commitb6e23235f28b1c85e18e9a2b7ba8c6b6c46aecbc (patch)
tree00fdd9c37c261d89c994fc1856252df719afec3a /lib/sh/stringvec.c
parent8581f42df9a1b1d848e2d4bdf3cc951b8d14b5be (diff)
downloadbash-4.3-testing.tar.gz
bash-4.3-rc2 overlaybash-4.3-rc2bash-4.3-testing
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)