+/**
+ * Make sure @p flist is big enough to hold at least @p flist->count
+ * entries.
+ **/
+static void flist_expand(struct file_list *flist)
+{
+ if (flist->count >= flist->malloced) {
+ if (flist->malloced < 1000)
+ flist->malloced += 1000;
+ else
+ flist->malloced *= 2;
+ flist->files = (struct file_struct **)
+ realloc(flist->files,
+ sizeof(flist->files[0]) * flist->malloced);
+ if (!flist->files)
+ out_of_memory("flist_expand");
+ }
+}
+
+