zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: completion allocation
Date: Fri, 5 May 2000 14:04:31 +0200 (MET DST)	[thread overview]
Message-ID: <200005051204.OAA02699@beta.informatik.hu-berlin.de> (raw)


I doubt that any of this has anything to do with the problem reported
by Felix, which I think has to do with uninitialised memory.

All other uses of *alloc() initialise the allocated memory directly
after allocation. Hm.

Bye
 Sven

Index: Src/Zle/comp.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/comp.h,v
retrieving revision 1.3
diff -u -r1.3 comp.h
--- Src/Zle/comp.h	2000/05/02 10:31:11	1.3
+++ Src/Zle/comp.h	2000/05/05 12:01:26
@@ -65,6 +65,7 @@
     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 @@
     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() */
 };
 
 
Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.15
diff -u -r1.15 compcore.c
--- Src/Zle/compcore.c	2000/05/04 07:44:21	1.15
+++ Src/Zle/compcore.c	2000/05/05 12:01:27
@@ -2339,13 +2339,14 @@
     }
     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 @@
 
     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 @@
 		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;

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2000-05-05 12:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200005051204.OAA02699@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).