summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index cb028e315..b72132895 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1198,14 +1198,12 @@ ca_parse_line(Cadef d, int multi)
 
 	    if (state.def->type == CAA_REST || state.def->type == CAA_RARGS ||
 		state.def->type == CAA_RREST) {
-		if (state.curopt)
-		    state.oopt++;
 		if (state.def->end && pattry(endpat, line)) {
 		    state.def = NULL;
 		    state.curopt = NULL;
 		    state.opt = state.arg = 1;
 		    state.argend = ca_laststate.argend = cur - 1;
-		    continue;
+		    goto cont;
 		}
 	    } else if ((state.def = state.def->next)) {
 		state.argbeg = cur;
@@ -1379,6 +1377,8 @@ ca_parse_line(Cadef d, int multi)
 
 	/* Copy the state into the global one. */
 
+    cont:
+
 	if (cur + 1 == compcurrent) {
 	    memcpy(&ca_laststate, &state, sizeof(state));
 	    ca_laststate.ddef = NULL;