summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-09-14 03:38:34 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-09-16 03:53:00 +0000
commit09a6e96cc02348c13d2f17dae571b818cccbb631 (patch)
treeba996ad455680473c372ed0959978b77b33a3338
parentc5f165a525dfcc3521f5e11cfaf023c632a7b131 (diff)
downloadzsh-09a6e96cc02348c13d2f17dae571b818cccbb631.tar.gz
zsh-09a6e96cc02348c13d2f17dae571b818cccbb631.zip
39310/0006: internals: match_str: Downscope local variable 'bpc'.
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/compmatch.c10
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 617877541..dad1f92b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2016-09-16 Daniel Shahaf <d.s@daniel.shahaf.name>
+ * 39310/0006: Src/Zle/compmatch.c: internals: match_str:
+ Downscope local variable 'bpc'.
+
* 39310/0005: Src/Zle/compmatch.c: internals: match_str:
Constify some local variables.
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index 5587bf37f..d007b14cc 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -501,7 +501,7 @@ 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 il = 0, iw = 0, t, he = 0, bpc, bslash;
+ int il = 0, iw = 0, t, he = 0, bslash;
char *ow;
Cmlist ms; /* loop variable */
Cmatcher mp, lm = NULL;
@@ -824,12 +824,14 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
bc += llen;
exact = 0;
- if (!test)
+ if (!test) {
+ int bpc;
while (bp &&
bc >= (bpc = (useqbr ? bp->qpos : bp->pos))) {
bp->curpos = matchbufadded + bpc - bc + obc;
bp = bp->next;
}
+ }
ow = w;
if (!llen && !alen) {
@@ -947,12 +949,14 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
bc += mp->llen;
exact = 0;
- if (!test)
+ if (!test) {
+ int bpc;
while (bp &&
bc >= (bpc = (useqbr ? bp->qpos : bp->pos))) {
bp->curpos = matchbufadded + bpc - bc + obc;
bp = bp->next;
}
+ }
ow = w;
lm = NULL;
he = 0;