From 31665068c12a0df574d490596f166886d6172405 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 14 Sep 2016 03:38:35 +0000 Subject: 39310/0007: internals: match_str: Rename and constify local variables 'oll', 'olw'. --- ChangeLog | 3 +++ Src/Zle/compmatch.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dad1f92b6..d7ff75b86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-09-16 Daniel Shahaf + * 39310/0007: Src/Zle/compmatch.c: internals: match_str: Rename + and constify local variables 'oll', 'olw'. + * 39310/0006: Src/Zle/compmatch.c: internals: match_str: Downscope local variable 'bpc'. diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index d007b14cc..f670de781 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -500,7 +500,7 @@ int match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, const int sfx, int test, int part) { - int ll = strlen(l), lw = strlen(w), oll = ll, olw = lw, exact = 0, wexact = 0; + int ll = strlen(l), lw = strlen(w), exact = 0, wexact = 0; int il = 0, iw = 0, t, he = 0, bslash; char *ow; Cmlist ms; /* loop variable */ @@ -509,6 +509,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, const int obc = bc; const int ind = (sfx ? -1 : 0); const int add = (sfx ? -1 : 1); + const int original_ll = ll, original_lw = lw; if (!test) { start_match(); @@ -585,7 +586,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, for (mp = ms->matcher; mp; mp = mp->next) { t = 1; if ((lm && lm == mp) || - ((oll == ll || olw == lw) && + ((original_ll == ll || original_lw == lw) && (test == 1 || (test && !mp->left && !mp->right)) && mp->wlen < 0)) /* If we were called recursively, don't use `*' patterns -- cgit 1.4.1