From fca4dce5aecbb14ddd2e6b8f0832417c68edc989 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 18 Oct 1999 09:48:38 +0000 Subject: zsh-workers/8315 --- Src/Zle/computil.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'Src') diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index b2c29d03e..a636ec066 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -1043,24 +1043,28 @@ ca_parse_line(Cadef d) if (!state.def) state.curopt = NULL; } else if (state.arg) { - PERMALLOC { - addlinknode(state.args, ztrdup(line)); - } LASTALLOC; + if (state.inopt) { + state.inopt = 0; + state.nargbeg = cur - 1; + } if ((adef = state.def = ca_get_arg(d, state.nth)) && (state.def->type == CAA_RREST || state.def->type == CAA_RARGS)) { state.inrest = 0; + state.argbeg = cur; for (; line; line = compwords[cur++]) { PERMALLOC { addlinknode(state.args, ztrdup(line)); } LASTALLOC; } + memcpy(&ca_laststate, &state, sizeof(state)); + ca_laststate.ddef = NULL; + ca_laststate.doff = 0; break; } - if (state.inopt) { - state.inopt = 0; - state.nargbeg = cur - 1; - } + PERMALLOC { + addlinknode(state.args, ztrdup(line)); + } LASTALLOC; if (state.def && state.def->type != CAA_NORMAL && state.def->type != CAA_OPT && state.inarg) { state.restbeg = cur; @@ -1083,6 +1087,9 @@ ca_parse_line(Cadef d) addlinknode(l, line); } LASTALLOC; } + memcpy(&ca_laststate, &state, sizeof(state)); + ca_laststate.ddef = NULL; + ca_laststate.doff = 0; break; } } -- cgit 1.4.1