about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/computil.c5
1 files changed, 4 insertions, 1 deletions
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;