From 04118530d4157d3494349e2628246b78465e08f8 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Fri, 5 May 2000 12:06:21 +0000 Subject: some more memory initialisation after allocation; shouldn't possibly have done any harm (11193) --- Src/Zle/compcore.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Src/Zle/compcore.c') 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; -- cgit v1.2.3