unexpand: spaces to tabs
This commit is contained in:
parent
36dc38acf6
commit
5a6715c0cf
26
unexpand.c
26
unexpand.c
|
@ -12,20 +12,20 @@ static int tablistlen = 8;
|
||||||
static size_t
|
static size_t
|
||||||
parselist(const char *s)
|
parselist(const char *s)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
char *p, *tmp;
|
char *p, *tmp;
|
||||||
|
|
||||||
tmp = estrdup(s);
|
tmp = estrdup(s);
|
||||||
for (i = 0; (p = strsep(&tmp, " ,")); i++) {
|
for (i = 0; (p = strsep(&tmp, " ,")); i++) {
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
eprintf("empty field in tablist\n");
|
eprintf("empty field in tablist\n");
|
||||||
tablist = erealloc(tablist, (i + 1) * sizeof(*tablist));
|
tablist = erealloc(tablist, (i + 1) * sizeof(*tablist));
|
||||||
tablist[i] = estrtonum(p, 1, MIN(LLONG_MAX, SIZE_MAX));
|
tablist[i] = estrtonum(p, 1, MIN(LLONG_MAX, SIZE_MAX));
|
||||||
if (i > 0 && tablist[i - 1] >= tablist[i])
|
if (i > 0 && tablist[i - 1] >= tablist[i])
|
||||||
eprintf("tablist must be ascending\n");
|
eprintf("tablist must be ascending\n");
|
||||||
}
|
}
|
||||||
tablist = erealloc(tablist, (i + 1) * sizeof(*tablist));
|
tablist = erealloc(tablist, (i + 1) * sizeof(*tablist));
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user