diff options
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/comp.h | 2 | ||||
-rw-r--r-- | Src/Zle/compcore.c | 10 |
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; |