about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-05 12:06:21 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-05 12:06:21 +0000
commit04118530d4157d3494349e2628246b78465e08f8 (patch)
treeba64a66a1a87fc43d50ca0352cad316ce9362094 /Src
parent057e9700ecb3c5fce374d0afc208798b4f345ee2 (diff)
downloadzsh-04118530d4157d3494349e2628246b78465e08f8.tar.gz
zsh-04118530d4157d3494349e2628246b78465e08f8.tar.xz
zsh-04118530d4157d3494349e2628246b78465e08f8.zip
some more memory initialisation after allocation; shouldn't possibly have done any harm (11193)
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/comp.h2
-rw-r--r--Src/Zle/compcore.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/Src/Zle/comp.h b/Src/Zle/comp.h
index 9239fbee0..3b49b2c25 100644
--- a/Src/Zle/comp.h
+++ b/Src/Zle/comp.h
@@ -65,6 +65,7 @@ struct cmgroup {
     int num;			/* number of this group */
     int nbrbeg;			/* number of opened braces */
     int nbrend;			/* number of closed braces */
+    int new;			/* new matches since last permalloc() */
     /* The following is collected/used during listing. */
     int dcount;			/* number of matches to list in columns */
     int cols;			/* number of columns */
@@ -74,7 +75,6 @@ struct cmgroup {
     int totl;			/* total length */
     int shortest;		/* length of shortest match */
     Cmgroup perm;		/* perm. alloced version of this group */
-    int new;			/* new matches since last permalloc() */
 };
 
 
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 542c5eebc..e04973b0a 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -2339,13 +2339,14 @@ begcmgroup(char *n, int flags)
     }
     mgroup = (Cmgroup) zhalloc(sizeof(struct cmgroup));
     mgroup->name = dupstring(n);
-    mgroup->lcount = mgroup->llcount = mgroup->mcount = 0;
+    mgroup->lcount = mgroup->llcount = mgroup->mcount = mgroup->ecount = 
+	mgroup->ccount = 0;
     mgroup->flags = flags;
     mgroup->matches = NULL;
     mgroup->ylist = NULL;
     mgroup->expls = NULL;
     mgroup->perm = NULL;
-    mgroup->new = 0;
+    mgroup->new = mgroup->num = mgroup->nbrbeg = mgroup->nbrend = 0;
 
     mgroup->lexpls = expls = newlinklist();
     mgroup->lmatches = matches = newlinklist();
@@ -2353,7 +2354,9 @@ begcmgroup(char *n, int flags)
 
     mgroup->lallccs = allccs = ((flags & CGF_NOSORT) ? NULL : newlinklist());
 
-    mgroup->next = amatches;
+    if ((mgroup->next = amatches))
+	amatches->prev = mgroup;
+    mgroup->prev = NULL;
     amatches = mgroup;
 }
 
@@ -2713,6 +2716,7 @@ permmatches(int last)
 		for (eq = g->expls; (o = *eq); eq++, ep++) {
 		    *ep = e = (Cexpl) zcalloc(sizeof(struct cexpl));
 		    e->count = (fi ? o->fcount : o->count);
+		    e->fcount = 0;
 		    e->str = ztrdup(o->str);
 		}
 		*ep = NULL;