From 962624e8c343e3968fbb55160b8a14b460400bc0 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 19 Jun 2011 16:26:10 +0000 Subject: 29491: remove some variables set but not used --- Src/Zle/complist.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Src/Zle/complist.c') diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index fdca7a99f..c9c0c2dd4 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -1369,8 +1369,6 @@ compprintlist(int showall) } #endif if ((e = g->expls)) { - int l; - if (!lastused && lasttype == 1) { e = lastexpl; ml = lastml; @@ -1393,9 +1391,9 @@ compprintlist(int showall) } if (mlbeg < 0 && mfirstl < 0) mfirstl = ml; - l = compprintfmt((*e)->str, - ((*e)->always ? -1 : (*e)->count), - dolist(ml), 1, ml, &stop); + (void)compprintfmt((*e)->str, + ((*e)->always ? -1 : (*e)->count), + dolist(ml), 1, ml, &stop); if (mselect >= 0) { int mm = (mcols * ml), i; -- cgit v1.2.3 From 84f8330e0dc88d4115b367432fd7b430eb332c8e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 18 Sep 2011 17:44:12 +0000 Subject: users/16375: initialise nrefs on each loop in match tests --- ChangeLog | 8 +++++++- Src/Zle/complist.c | 10 ++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'Src/Zle/complist.c') diff --git a/ChangeLog b/ChangeLog index c3b589bf7..4e69f9654 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-09-18 Peter Stephenson + + * users/16375: Src/Zle/complist.c: initialise number of + references each time for multiple match tests when + highlighting. + 2011-09-16 Mikael Magnusson * 29764, 29765: Completion/Unix/Command/_pgrep: use _users and @@ -15424,5 +15430,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5468 $ +* $Revision: 1.5469 $ ***************************************************** diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index c9c0c2dd4..bcf356179 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -849,9 +849,9 @@ putmatchcol(char *group, char *n) { Patcol pc; - nrefs = MAX_POS - 1; + for (pc = mcolors.pats; pc; pc = pc->next) { + nrefs = MAX_POS - 1; - for (pc = mcolors.pats; pc; pc = pc->next) if ((!pc->prog || !group || pattry(pc->prog, group)) && pattryrefs(pc->pat, n, -1, -1, 0, &nrefs, begpos, endpos)) { if (pc->cols[1]) { @@ -863,6 +863,7 @@ putmatchcol(char *group, char *n) return 0; } + } zcputs(group, COL_NO); @@ -880,9 +881,9 @@ putfilecol(char *group, char *filename, mode_t m, int special) Patcol pc; int len; - nrefs = MAX_POS - 1; + for (pc = mcolors.pats; pc; pc = pc->next) { + nrefs = MAX_POS - 1; - for (pc = mcolors.pats; pc; pc = pc->next) if ((!pc->prog || !group || pattry(pc->prog, group)) && pattryrefs(pc->pat, filename, -1, -1, 0, &nrefs, begpos, endpos)) { if (pc->cols[1]) { @@ -894,6 +895,7 @@ putfilecol(char *group, char *filename, mode_t m, int special) return 0; } + } if (special != -1) { colour = special; -- cgit v1.2.3