summaryrefslogtreecommitdiff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-15 08:09:09 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-15 08:09:09 +0000
commitdc102b813026240217920f5a027f47d12241913b (patch)
tree83f243cb769e2882d02142c097afe015a3440b32 /Src/Zle/computil.c
parenta777f021a2101c90335f6f88eb31895df0e6f0a6 (diff)
downloadzsh-dc102b813026240217920f5a027f47d12241913b.tar.gz
zsh-dc102b813026240217920f5a027f47d12241913b.zip
fix for _arguments, it took non-option strings as options (11910)
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index b58729fc1..51a1f61aa 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1083,7 +1083,7 @@ ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp)
LinkList l = NULL;
*lp = NULL;
- for (p = NULL; *line; line++)
+ for (p = NULL; *line; line++) {
if ((p = d->single[STOUC(*line)]) && p->active &&
p->args && p->name[0] == pre) {
if (p->type == CAO_NEXT) {
@@ -1100,8 +1100,10 @@ ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp)
}
break;
}
- } else if (!p || (!p->active && p->name[0] != pre))
+ } else if (p && !p->active)
return NULL;
+ p = NULL;
+ }
if (p && end)
*end = line;
return p;
@@ -1444,7 +1446,14 @@ ca_parse_line(Cadef d, int multi, int first)
state.opt = 0;
else
state.curopt = NULL;
- } else if (multi && (*line == '-' || *line == '+') && cur != compcurrent)
+ } else if (multi && (*line == '-' || *line == '+') && cur != compcurrent
+#if 0
+ /**** Ouch. Using this will disable the mutual exclusion
+ of different sets. Not using it will make the -A
+ pattern be effectively ignored with multiple sets. */
+ && (!napat || !pattry(napat, line))
+#endif
+ )
return 1;
else if (state.arg && (!napat || !pattry(napat, line))) {
/* Otherwise it's a normal argument. */