awk: style fixes

This commit is contained in:
Denis Vlasenko 2007-01-01 23:53:52 +00:00
parent 6dc6ebbf44
commit e1d3e034a9

View File

@ -848,19 +848,15 @@ static uint32_t next_token(uint32_t expected)
int l;
if (t.rollback) {
t.rollback = FALSE;
} else if (concat_inserted) {
concat_inserted = FALSE;
t.tclass = save_tclass;
t.info = save_info;
} else {
p = pos;
readnext:
skip_spaces(&p);
lineno = t.lineno;
@ -1402,7 +1398,7 @@ static void qrealloc(char **b, int n, int *size)
/* resize field storage space */
static void fsrealloc(int size)
{
static int maxfields = 0;
static int maxfields; /* = 0;*/
int i;
if (size >= maxfields) {
@ -1457,8 +1453,8 @@ static int awk_split(char *s, node *spl, char **slist)
}
} else if (c[0] == '\0') { /* null split */
while (*s) {
*(s1++) = *(s++);
*(s1++) = '\0';
*s1++ = *s++;
*s1++ = '\0';
n++;
}
} else if (c[0] != ' ') { /* single-character split */
@ -1468,7 +1464,7 @@ static int awk_split(char *s, node *spl, char **slist)
}
if (*s1) n++;
while ((s1 = strpbrk(s1, c))) {
*(s1++) = '\0';
*s1++ = '\0';
n++;
}
} else { /* space split */
@ -1477,8 +1473,8 @@ static int awk_split(char *s, node *spl, char **slist)
if (!*s) break;
n++;
while (*s && !isspace(*s))
*(s1++) = *(s++);
*(s1++) = '\0';
*s1++ = *s++;
*s1++ = '\0';
}
}
return n;
@ -1540,7 +1536,8 @@ static void handle_special(var *v)
memcpy(b+len, s, l);
len += l;
}
if (b) b[len] = '\0';
if (b)
b[len] = '\0';
setvar_p(V[F0], b);
is_f0_split = TRUE;
@ -1781,7 +1778,6 @@ static char *awk_printf(node *n)
/* if there was an error while sprintf, return value is negative */
if (i < j) i = j;
}
b = xrealloc(b, i + 1);
@ -2053,6 +2049,7 @@ static var *evaluate(node *op, var *res)
static var *fnargs = NULL;
static unsigned seed = 1;
static regex_t sreg;
node *op1;
var *v1;
union {
@ -2224,9 +2221,8 @@ static var *evaluate(node *op, var *res)
case XC( OC_FNARG ):
L.v = &fnargs[op->l.i];
v_cont:
res = (op->r.n) ? findvar(iamarray(L.v), R.s) : L.v;
res = op->r.n ? findvar(iamarray(L.v), R.s) : L.v;
break;
case XC( OC_IN ):