summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorm0viefreak <m0viefreak.cm@googlemail.com>2014-05-08 14:45:41 +0200
committerPeter Stephenson <pws@zsh.org>2014-05-08 14:24:31 +0100
commitf5fe52c49587cabdc7df18aeb83ca80f2a41ff97 (patch)
treeee9992e294bc0edd4c8a137dc6366c623d5c34e9 /Src
parent6a201af3416ae177a66486e9af500c25a117c91e (diff)
downloadzsh-f5fe52c49587cabdc7df18aeb83ca80f2a41ff97.tar.gz
zsh-f5fe52c49587cabdc7df18aeb83ca80f2a41ff97.tar.xz
zsh-f5fe52c49587cabdc7df18aeb83ca80f2a41ff97.zip
32600: in _arguments, "-" is not an option letter after another "-"
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/computil.c10
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();