From c6753c1666d11391da56ebd5a2048af07f3bc9be Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 1 Jul 2007 18:33:35 +0000 Subject: expr: small code shrink --- coreutils/expr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'coreutils/expr.c') diff --git a/coreutils/expr.c b/coreutils/expr.c index 46e18d190..ab182a804 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -277,12 +277,15 @@ static VALUE *eval7(void) static VALUE *eval6(void) { - VALUE *l, *r, *v = NULL /* silence gcc */, *i1, *i2; static const char * const keywords[] = { "quote", "length", "match", "index", "substr", NULL }; - smalluint key = *G.args ? index_in_str_array(keywords, *G.args) + 1 : 0; + VALUE *r, *i1, *i2; + VALUE *l = l; /* silence gcc */ + VALUE *v = v; /* silence gcc */ + int key = *G.args ? index_in_str_array(keywords, *G.args) + 1 : 0; + if (key == 0) /* not a keyword */ return eval7(); G.args++; /* We have a valid token, so get the next argument. */ @@ -320,8 +323,8 @@ static VALUE *eval6(void) i2 = eval6(); tostring(l); if (!toarith(i1) || !toarith(i2) - || i1->u.i > (arith_t) strlen(l->u.s) - || i1->u.i <= 0 || i2->u.i <= 0) + || i1->u.i > (arith_t) strlen(l->u.s) + || i1->u.i <= 0 || i2->u.i <= 0) v = str_value(""); else { v = xmalloc(sizeof(VALUE)); -- cgit v1.2.3