+/* Examples will often build on prior ones. Try combining them. */
+static char **combine(char **lines, char **prev)
+{
+ unsigned int i, lines_total, prev_total, count;
+ char **ret;
+
+ if (!prev)
+ return NULL;
+
+ /* If it looks internal, put prev at start. */
+ if (lines[0]
+ && isblank(lines[0][0])
+ && looks_internal(lines[0] + strspn(lines[0], " \t"))) {
+ count = 0;
+ } else {
+ /* Try inserting in first elided position */
+ for (count = 0; lines[count]; count++) {
+ if (strcmp(lines[count], "...") == 0)
+ break;
+ }
+ if (!lines[count])
+ return NULL;
+ count++;
+ }
+
+ for (i = 0; lines[i]; i++);
+ lines_total = i;
+
+ for (i = 0; prev[i]; i++);
+ prev_total = i;
+
+ ret = talloc_array(lines, char *, lines_total + prev_total + 1);
+ memcpy(ret, lines, count * sizeof(ret[0]));
+ memcpy(ret + count, prev, prev_total * sizeof(ret[0]));
+ memcpy(ret + count + prev_total, lines + count,
+ (lines_total - count + 1) * sizeof(ret[0]));
+ return ret;
+}
+
+static char *mangle(struct manifest *m, char **lines)