mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-24 05:11:08 +02:00
39310/0006: internals: match_str: Downscope local variable 'bpc'.
This commit is contained in:
parent
c5f165a525
commit
09a6e96cc0
2 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
||||||
2016-09-16 Daniel Shahaf <d.s@daniel.shahaf.name>
|
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:
|
* 39310/0005: Src/Zle/compmatch.c: internals: match_str:
|
||||||
Constify some local variables.
|
Constify some local variables.
|
||||||
|
|
||||||
|
|
|
@ -501,7 +501,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
|
||||||
const int sfx, int test, int part)
|
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), 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;
|
char *ow;
|
||||||
Cmlist ms; /* loop variable */
|
Cmlist ms; /* loop variable */
|
||||||
Cmatcher mp, lm = NULL;
|
Cmatcher mp, lm = NULL;
|
||||||
|
@ -824,12 +824,14 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
|
||||||
bc += llen;
|
bc += llen;
|
||||||
exact = 0;
|
exact = 0;
|
||||||
|
|
||||||
if (!test)
|
if (!test) {
|
||||||
|
int bpc;
|
||||||
while (bp &&
|
while (bp &&
|
||||||
bc >= (bpc = (useqbr ? bp->qpos : bp->pos))) {
|
bc >= (bpc = (useqbr ? bp->qpos : bp->pos))) {
|
||||||
bp->curpos = matchbufadded + bpc - bc + obc;
|
bp->curpos = matchbufadded + bpc - bc + obc;
|
||||||
bp = bp->next;
|
bp = bp->next;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ow = w;
|
ow = w;
|
||||||
|
|
||||||
if (!llen && !alen) {
|
if (!llen && !alen) {
|
||||||
|
@ -947,12 +949,14 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
|
||||||
bc += mp->llen;
|
bc += mp->llen;
|
||||||
exact = 0;
|
exact = 0;
|
||||||
|
|
||||||
if (!test)
|
if (!test) {
|
||||||
|
int bpc;
|
||||||
while (bp &&
|
while (bp &&
|
||||||
bc >= (bpc = (useqbr ? bp->qpos : bp->pos))) {
|
bc >= (bpc = (useqbr ? bp->qpos : bp->pos))) {
|
||||||
bp->curpos = matchbufadded + bpc - bc + obc;
|
bp->curpos = matchbufadded + bpc - bc + obc;
|
||||||
bp = bp->next;
|
bp = bp->next;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ow = w;
|
ow = w;
|
||||||
lm = NULL;
|
lm = NULL;
|
||||||
he = 0;
|
he = 0;
|
||||||
|
|
Loading…
Reference in a new issue