1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-29 15:31:28 +02:00

fix for _arguments, it took non-option strings as options (11910)

This commit is contained in:
Sven Wischnowsky 2000-06-15 08:09:09 +00:00
parent a777f021a2
commit dc102b8130
2 changed files with 17 additions and 3 deletions

@ -1,3 +1,8 @@
2000-06-15 Sven Wischnowsky <wischnow@zsh.org>
* 11910: Src/Zle/computil.c: fix for _arguments, it took
non-option strings as options
2000-06-14 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> 2000-06-14 Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
* 11906: Src/signals.c: yet another two bugs with saving traps: * 11906: Src/signals.c: yet another two bugs with saving traps:

@ -1083,7 +1083,7 @@ ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp)
LinkList l = NULL; LinkList l = NULL;
*lp = NULL; *lp = NULL;
for (p = NULL; *line; line++) for (p = NULL; *line; line++) {
if ((p = d->single[STOUC(*line)]) && p->active && if ((p = d->single[STOUC(*line)]) && p->active &&
p->args && p->name[0] == pre) { p->args && p->name[0] == pre) {
if (p->type == CAO_NEXT) { if (p->type == CAO_NEXT) {
@ -1100,8 +1100,10 @@ ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp)
} }
break; break;
} }
} else if (!p || (!p->active && p->name[0] != pre)) } else if (p && !p->active)
return NULL; return NULL;
p = NULL;
}
if (p && end) if (p && end)
*end = line; *end = line;
return p; return p;
@ -1444,7 +1446,14 @@ ca_parse_line(Cadef d, int multi, int first)
state.opt = 0; state.opt = 0;
else else
state.curopt = NULL; 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; return 1;
else if (state.arg && (!napat || !pattry(napat, line))) { else if (state.arg && (!napat || !pattry(napat, line))) {
/* Otherwise it's a normal argument. */ /* Otherwise it's a normal argument. */