diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-06-01 08:53:50 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-06-01 08:53:50 +0000 |
commit | 0ce4b800a328467f2ef1d27f4a6b2f96b36a5baf (patch) | |
tree | 64eaf25c249db83fed2ec6094baf62c41da665c6 | |
parent | d101cd7411152358e57a392aff871bee6fff3dd4 (diff) | |
download | zsh-0ce4b800a328467f2ef1d27f4a6b2f96b36a5baf.tar.gz zsh-0ce4b800a328467f2ef1d27f4a6b2f96b36a5baf.tar.xz zsh-0ce4b800a328467f2ef1d27f4a6b2f96b36a5baf.zip |
fix for exclusion of normal arguments (14630)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/Zle/computil.c | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index 9a13576d1..1c5b78098 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-06-01 Sven Wischnowsky <wischnow@zsh.org> + + * 14630: Src/Zle/computil.c: fix for exclusion of normal + arguments + 2001-06-01 Andrej Borsenkow <bor@zsh.org> * unposted: Etc/MACHINES: Cygwin belongs now to Red Hat. Mention diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 85fde0dba..0f6b70e01 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -1130,9 +1130,11 @@ ca_get_arg(Cadef d, int n) if (d->argsactive) { Caarg a = d->args; - while (a && (n < a->min || n > a->num)) + while (a && (!a->active || n < a->min || n > a->num)) { + if (!a->active) + n++; a = a->next; - + } if (a && a->min <= n && a->num >= n && a->active) return a; @@ -1154,7 +1156,7 @@ ca_inactive(Cadef d, char **xor, int cur, int opts, char *optname) int sl = (d->set ? strlen(d->set) : -1), set = 0; for (; (x = (opts ? "-" : *xor)); xor++) { - if (optname && strcmp(optname, x)) + if (optname && optname[0] == x[0] && strcmp(optname, x)) continue; if (ca_xor) addlinknode(ca_xor, x); @@ -1403,7 +1405,8 @@ ca_parse_line(Cadef d, int multi, int first) if (!state.oargs[state.curopt->num]) state.oargs[state.curopt->num] = znewlinklist(); - if (ca_inactive(d, state.curopt->xor, cur, 0, state.curopt->name)) + if (ca_inactive(d, state.curopt->xor, cur, 0, + (cur == compcurrent ? state.curopt->name : NULL))) return 1; /* Collect the argument strings. Maybe. */ @@ -1456,7 +1459,8 @@ ca_parse_line(Cadef d, int multi, int first) if (!state.oargs[tmpopt->num]) state.oargs[tmpopt->num] = znewlinklist(); - if (ca_inactive(d, tmpopt->xor, cur, 0, tmpopt->name)) + if (ca_inactive(d, tmpopt->xor, cur, 0, + (cur == compcurrent ? tmpopt->name : NULL))) return 1; } } @@ -1523,6 +1527,8 @@ ca_parse_line(Cadef d, int multi, int first) break; } zaddlinknode(state.args, ztrdup(line)); + if (adef) + state.oopt = adef->num - state.nth; if (state.def) argxor = state.def->xor; |