diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2014-08-11 17:39:42 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2014-08-11 17:39:42 +0200 |
commit | 382c26acfc62a56744ab9eb603efc56130764fd3 (patch) | |
tree | 1b7cb9d3e372481007fc4546e7d06ce5bb1bc104 /Src/Zle/computil.c | |
parent | 73508e345b4925f33b7f652aba9bd313169e5ac2 (diff) | |
parent | f8ae47f29b766dc0330b19d7fdb35859d6aab930 (diff) | |
download | zsh-382c26acfc62a56744ab9eb603efc56130764fd3.tar.gz zsh-382c26acfc62a56744ab9eb603efc56130764fd3.zip |
New upstream release candidate: Merge branch 'upstream' into debian
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r-- | Src/Zle/computil.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index f5e6ba195..b11c39f25 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -1500,9 +1500,11 @@ parse_cadef(char *nam, char **args) nodopts++; /* If this is for single-letter option we also store a - * pointer for the definition in the array for fast lookup. */ + * pointer for the definition in the array for fast lookup. + * But don't treat '--' as a single option called '-' */ - if (single && name[1] && !name[2]) + + if (single && name[1] && !name[2] && name[1] != '-') ret->single[STOUC(name[1])] = opt; if (again == 1) { @@ -2034,7 +2036,9 @@ ca_parse_line(Cadef d, int multi, int first) state.optbeg = state.argbeg = state.inopt = cur; state.argend = argend; state.singles = (d->single && (!pe || !*pe) && - state.curopt->name[1] && !state.curopt->name[2]); + state.curopt->name[1] && !state.curopt->name[2] && + /* Don't treat '--' as a single option called '-' */ + state.curopt->name[1] != '-'); if (!state.oargs[state.curopt->num]) state.oargs[state.curopt->num] = znewlinklist(); |