about summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-31 11:49:09 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-31 11:49:09 +0000
commitd8ac1ebc18d7dc64fdd3751ea548996d2c64c5ee (patch)
treebbafaf760c68bd94ecf3c4a80cf3c5dd7d1e5616 /Src/Zle/computil.c
parent2059cfccced3756925c498480cd47c80ad4ee208 (diff)
downloadzsh-d8ac1ebc18d7dc64fdd3751ea548996d2c64c5ee.tar.gz
zsh-d8ac1ebc18d7dc64fdd3751ea548996d2c64c5ee.tar.xz
zsh-d8ac1ebc18d7dc64fdd3751ea548996d2c64c5ee.zip
zsh-workers/9494
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index daccb6a22..44deee765 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1019,7 +1019,7 @@ static void
 ca_parse_line(Cadef d)
 {
     Caarg adef, ddef;
-    Caopt ptr;
+    Caopt ptr, wasopt;
     struct castate state;
     char *line, *pe;
     int cur, doff;
@@ -1107,6 +1107,8 @@ ca_parse_line(Cadef d)
 
 	pe = NULL;
 
+	wasopt = NULL;
+
 	/* See if it's an option. */
 
 	if (state.opt == 2 && (state.curopt = ca_get_opt(d, line, 0, &pe)) &&
@@ -1141,8 +1143,11 @@ ca_parse_line(Cadef d)
 	    }
 	    if (state.def)
 		state.opt = 0;
-	    else
+	    else {
+		if (!d->single || (state.curopt->name[1] && state.curopt->name[2]))
+		    wasopt = state.curopt;
 		state.curopt = NULL;
+	    }
 	} else if (state.opt == 2 && d->single &&
 		   (state.curopt = ca_get_sopt(d, line, 0, &pe))) {
 	    /* Or maybe it's a single-letter option? */
@@ -1262,6 +1267,8 @@ ca_parse_line(Cadef d)
 		ca_laststate.optbeg = state.nargbeg;
 		ca_laststate.argbeg = state.restbeg;
 		ca_laststate.singles = state.singles;
+		if (wasopt)
+		    wasopt->active = 1;
 	    }
 	}
     }