>From 1304e6473db8d1fdb6d7a8ada741a61a38984b88 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 14 Sep 2016 03:38:35 +0000 Subject: [PATCH 09/10] internals: match_str: Downscope local variable 't'. Remove needless initialization (it is written to again before it is ever read). Note there was another 't' variable at the end of the function that shadowed the int 't'. --- Src/Zle/compmatch.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index 16705f6..1d4bef8 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -508,7 +508,6 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, int exact = 0, wexact = 0; int he = 0; int bslash; - int t; char *ow; Cmlist ms; /* loop variable */ Cmatcher mp, lm = NULL; @@ -593,7 +592,6 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, /* First try the matchers. Err... see above. */ for (mp = NULL, ms = mstack; !mp && ms; ms = ms->next) { for (mp = ms->matcher; mp; mp = mp->next) { - t = 1; if ((lm && lm == mp) || ((original_ll == ll || original_lw == lw) && (test == 1 || (test && !mp->left && !mp->right)) && @@ -603,6 +601,11 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, continue; if (mp->wlen < 0) { + /* `*'-pattern. */ + /* + * Similar to the identically-named variable in the 'else' block. + */ + int t; /* * 1 iff the anchor and the word are on the same side of * the line pattern; that is: if either @@ -856,6 +859,10 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, break; } else if (ll >= mp->llen && lw >= mp->wlen) { /* Non-`*'-pattern. */ + /* + * Similar to the identically-named variable in the 'if' block. + */ + int t = 1; char *tl, *tw; int tll, tlw, til, tiw;