diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-12-08 13:58:38 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-12-08 13:58:38 +0000 |
commit | f55f6cd3b39989075ce2abfe6b2684fa16fef946 (patch) | |
tree | 60b47b67a74639d618efaceb338ee2d9ad90e47e /Src/Zle/compcore.c | |
parent | 05bd75dffd755d176c045b598d7f2dbff033bf9a (diff) | |
download | zsh-f55f6cd3b39989075ce2abfe6b2684fa16fef946.tar.gz zsh-f55f6cd3b39989075ce2abfe6b2684fa16fef946.tar.xz zsh-f55f6cd3b39989075ce2abfe6b2684fa16fef946.zip |
zsh-workers/8945
Diffstat (limited to 'Src/Zle/compcore.c')
-rw-r--r-- | Src/Zle/compcore.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index c2767f90c..acf1799f6 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -2368,16 +2368,21 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp) (int (*) _((const void *, const void *)))matchcmp); if (!(flags & CGF_UNIQCON)) { + int dup; + /* And delete the ones that occur more than once. */ for (ap = cp = rp; *ap; ap++) { *cp++ = *ap; for (bp = ap; bp[1] && matcheq(*ap, bp[1]); bp++, n--); ap = bp; /* Mark those, that would show the same string in the list. */ - for (; bp[1] && !(*ap)->disp && !(bp[1])->disp && - !strcmp((*ap)->str, (bp[1])->str); bp++) + for (dup = 0; bp[1] && !(*ap)->disp && !(bp[1])->disp && + !strcmp((*ap)->str, (bp[1])->str); bp++) { (bp[1])->flags |= CMF_MULT; - (*ap)->flags |= CMF_FMULT; + dup = 1; + } + if (dup) + (*ap)->flags |= CMF_FMULT; } *cp = NULL; } @@ -2399,14 +2404,19 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp) *cp = NULL; } } else if (!(flags & CGF_UNIQCON)) { + int dup; + for (ap = cp = rp; *ap; ap++) { *cp++ = *ap; for (bp = ap; bp[1] && matcheq(*ap, bp[1]); bp++, n--); ap = bp; - for (; bp[1] && !(*ap)->disp && !(bp[1])->disp && - !strcmp((*ap)->str, (bp[1])->str); bp++) + for (dup = 0; bp[1] && !(*ap)->disp && !(bp[1])->disp && + !strcmp((*ap)->str, (bp[1])->str); bp++) { (bp[1])->flags |= CMF_MULT; - (*ap)->flags |= CMF_FMULT; + dup = 1; + } + if (dup) + (*ap)->flags |= CMF_FMULT; } *cp = NULL; } |