From 3bca186819e7e1e0fc6321592ccc62d75e0525be Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 8 Aug 2000 12:11:42 +0000 Subject: handle the right option in strings with multiple single-letter options (and correctly handle its argument) (12567) --- ChangeLog | 4 ++++ Completion/Linux/_rpm | 2 +- Src/Zle/computil.c | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 902dcf003..c205c1cc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2000-08-08 Sven Wischnowsky + * 12567: Completion/Linux/_rpm, Src/Zle/computil.c: handle the + right option in strings with multiple single-letter options (and + correctly handle its argument) + * 12565: Completion/Core/_expand, Completion/Core/_path_files, Doc/Zsh/mod_computil.yo, Src/Zle/computil.c: more fixes for completion of special characters (quoting) diff --git a/Completion/Linux/_rpm b/Completion/Linux/_rpm index 11bb370b8..34bf30e73 100644 --- a/Completion/Linux/_rpm +++ b/Completion/Linux/_rpm @@ -59,7 +59,7 @@ _rpm () { ) packageopts=( '-a[query all packages]' - '-p+[query uninstalled package file]:*:RPM package file:->package_file' + '-p[query uninstalled package file]:*:RPM package file:->package_file' '-f[specify file to query owner of]:file:_files' '--triggeredby:RPM package:->package' '--whatprovides:RPM capability:->capability' diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 863f15fa1..fcc79b2c4 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -1108,6 +1108,7 @@ ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp) line++; *end = line; } + pp = p; break; } } else if (!p || (p && !p->active)) @@ -1429,7 +1430,9 @@ ca_parse_line(Cadef d, int multi, int first) if (!state.oargs[state.curopt->num]) state.oargs[state.curopt->num] = znewlinklist(); - ddef = state.def = state.curopt->args; + state.def = state.curopt->args; + ddef = (state.curopt->type == CAO_NEXT && cur == compcurrent ? + NULL : state.def); dopt = state.curopt; doff = pe - line; state.optbeg = state.argbeg = state.inopt = cur; -- cgit 1.4.1