mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-05 08:41:15 +02:00
fix group handling nothing should now possibly be added to the wrong group again (16668)
This commit is contained in:
parent
901d8b4c97
commit
fa509f5219
2 changed files with 22 additions and 27 deletions
|
@ -1,5 +1,8 @@
|
||||||
2002-02-18 Sven Wischnowsky <wischnow@zsh.org>
|
2002-02-18 Sven Wischnowsky <wischnow@zsh.org>
|
||||||
|
|
||||||
|
* 16668: Src/Zle/compcore.c: fix group handling nothing should
|
||||||
|
now possibly be added to the wrong group again
|
||||||
|
|
||||||
* 16667: Completion/Base/Utility/_arguments: fix test for
|
* 16667: Completion/Base/Utility/_arguments: fix test for
|
||||||
prefix-needed
|
prefix-needed
|
||||||
|
|
||||||
|
|
|
@ -1619,6 +1619,21 @@ addmatches(Cadata dat, char **argv)
|
||||||
Heap oldheap;
|
Heap oldheap;
|
||||||
|
|
||||||
SWITCHHEAPS(oldheap, compheap) {
|
SWITCHHEAPS(oldheap, compheap) {
|
||||||
|
if (dat->dummies)
|
||||||
|
dat->aflags = ((dat->aflags | CAF_NOSORT | CAF_UNIQCON) &
|
||||||
|
~CAF_UNIQALL);
|
||||||
|
|
||||||
|
/* Select the group in which to store the matches. */
|
||||||
|
gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT : 0) |
|
||||||
|
((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) |
|
||||||
|
((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0));
|
||||||
|
if (dat->group) {
|
||||||
|
endcmgroup(NULL);
|
||||||
|
begcmgroup(dat->group, gflags);
|
||||||
|
} else {
|
||||||
|
endcmgroup(NULL);
|
||||||
|
begcmgroup("default", 0);
|
||||||
|
}
|
||||||
if (dat->mesg || dat->exp) {
|
if (dat->mesg || dat->exp) {
|
||||||
curexpl = (Cexpl) zhalloc(sizeof(struct cexpl));
|
curexpl = (Cexpl) zhalloc(sizeof(struct cexpl));
|
||||||
curexpl->always = !!dat->mesg;
|
curexpl->always = !!dat->mesg;
|
||||||
|
@ -1630,25 +1645,13 @@ addmatches(Cadata dat, char **argv)
|
||||||
curexpl = NULL;
|
curexpl = NULL;
|
||||||
} SWITCHBACKHEAPS(oldheap);
|
} SWITCHBACKHEAPS(oldheap);
|
||||||
|
|
||||||
if (!*argv && !dat->dummies && !(dat->aflags & CAF_ALL)) {
|
if (!*argv && !dat->dummies && !(dat->aflags & CAF_ALL))
|
||||||
SWITCHHEAPS(oldheap, compheap) {
|
|
||||||
/* Select the group in which to store the matches. */
|
|
||||||
gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT : 0) |
|
|
||||||
((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) |
|
|
||||||
((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0));
|
|
||||||
if (dat->group) {
|
|
||||||
endcmgroup(NULL);
|
|
||||||
begcmgroup(dat->group, gflags);
|
|
||||||
} else {
|
|
||||||
endcmgroup(NULL);
|
|
||||||
begcmgroup("default", 0);
|
|
||||||
}
|
|
||||||
} SWITCHBACKHEAPS(oldheap);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
#if 0
|
||||||
if (dat->dummies)
|
if (dat->dummies)
|
||||||
dat->aflags = (dat->aflags | CAF_NOSORT | CAF_UNIQCON) & ~CAF_UNIQALL;
|
dat->aflags = (dat->aflags | CAF_NOSORT | CAF_UNIQCON) & ~CAF_UNIQALL;
|
||||||
|
#endif
|
||||||
for (bp = brbeg; bp; bp = bp->next)
|
for (bp = brbeg; bp; bp = bp->next)
|
||||||
bp->curpos = ((dat->aflags & CAF_QUOTE) ? bp->pos : bp->qpos);
|
bp->curpos = ((dat->aflags & CAF_QUOTE) ? bp->pos : bp->qpos);
|
||||||
for (bp = brend; bp; bp = bp->next)
|
for (bp = brend; bp; bp = bp->next)
|
||||||
|
@ -1881,17 +1884,6 @@ addmatches(Cadata dat, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Select the group in which to store the matches. */
|
|
||||||
gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT : 0) |
|
|
||||||
((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) |
|
|
||||||
((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0));
|
|
||||||
if (dat->group) {
|
|
||||||
endcmgroup(NULL);
|
|
||||||
begcmgroup(dat->group, gflags);
|
|
||||||
} else {
|
|
||||||
endcmgroup(NULL);
|
|
||||||
begcmgroup("default", 0);
|
|
||||||
}
|
|
||||||
if (*argv) {
|
if (*argv) {
|
||||||
if (dat->pre)
|
if (dat->pre)
|
||||||
dat->pre = dupstring(dat->pre);
|
dat->pre = dupstring(dat->pre);
|
||||||
|
|
Loading…
Reference in a new issue