about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-08 11:43:01 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-08 11:43:01 +0000
commit96ecd59d284e57bbd8f8bd61d919928dea1382f9 (patch)
tree64d14cc527b625a34e1d801dd1cff9694f009864 /Src
parenta1e0eed861cf18b043107f50823a9a498347d89f (diff)
downloadzsh-96ecd59d284e57bbd8f8bd61d919928dea1382f9.tar.gz
zsh-96ecd59d284e57bbd8f8bd61d919928dea1382f9.tar.xz
zsh-96ecd59d284e57bbd8f8bd61d919928dea1382f9.zip
zsh-workers/9618
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/computil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 4b0f11d7c..09d62ca81 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -875,7 +875,7 @@ get_cadef(char *nam, char **args)
     Cadef *p, *min, new;
     int i, na = arrlen(args);
 
-    for (i = MAX_CACACHE, p = cadef_cache, min = NULL; *p && i--; p++)
+    for (i = MAX_CACACHE, p = cadef_cache, min = NULL; *p && i; p++, i--)
 	if (*p && na == (*p)->ndefs && arrcmp(args, (*p)->defs)) {
 	    (*p)->lastt = time(0);
 
@@ -1003,6 +1003,7 @@ ca_inactive(Cadef d, char **xor)
 
 struct castate {
     Cadef d;
+    int nopts;
     Caarg def, ddef;
     Caopt curopt;
     int opt, arg, argbeg, optbeg, nargbeg, restbeg;
@@ -1029,7 +1030,7 @@ ca_parse_line(Cadef d)
     /* Free old state. */
 
     if (ca_alloced) {
-	int i = ca_laststate.d->nopts;
+	int i = ca_laststate.nopts;
 	LinkList *p = ca_laststate.oargs;
 
 	freelinklist(ca_laststate.args, freestr);
@@ -1048,6 +1049,7 @@ ca_parse_line(Cadef d)
     /* Default values for the state. */
 
     state.d = d;
+    state.nopts = d->nopts;
     state.def = state.ddef = NULL;
     state.curopt = NULL;
     state.argbeg = state.optbeg = state.nargbeg = state.restbeg =