+ ADVANCE_CHAR (text, tlen, i);
+ start = i;
+ }
+ return (result);
+}
+
+#define ST_BAD 0
+#define ST_INT 1
+#define ST_CHAR 2
+
+static char **
+mkseq (start, end, type)
+ int start, end, type;
+{
+ int n, incr, i;
+ char **result, *t;
+
+ n = abs (end - start) + 1;
+ result = strvec_create (n + 1);
+
+ incr = (start < end) ? 1 : -1;
+
+ /* Make sure we go through the loop at least once, so {3..3} prints `3' */
+ i = 0;
+ n = start;
+ do
+ {
+ if (type == ST_INT)
+ result[i++] = itos (n);
+ else
+ {
+ t = (char *)xmalloc (2);
+ t[0] = n;
+ t[1] = '\0';
+ result[i++] = t;
+ }
+ if (n == end)
+ break;
+ n += incr;
+ }
+ while (1);
+
+ result[i] = (char *)0;
+ return (result);
+}
+
+static char **
+expand_seqterm (text, tlen)
+ char *text;
+ size_t tlen;
+{
+ char *t, *lhs, *rhs;
+ int i, lhs_t, rhs_t, lhs_v, rhs_v;
+ intmax_t tl, tr;
+ char **result;
+
+ t = strstr (text, BRACE_SEQ_SPECIFIER);
+ if (t == 0)
+ return ((char **)NULL);
+
+ i = t - text; /* index of start of BRACE_SEQ_SPECIFIER */
+ lhs = substring (text, 0, i);
+ rhs = substring (text, i + sizeof(BRACE_SEQ_SPECIFIER) - 1, tlen);
+
+ if (lhs[0] == 0 || rhs[0] == 0)
+ {
+ free (lhs);
+ free (rhs);
+ return ((char **)NULL);