about summary refs log tree commit diff
path: root/Src/Zle/compctl.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-15 12:24:59 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-15 12:24:59 +0000
commit767eb17ee0a6be853be30cfc0a9ac3c6774eee23 (patch)
treef50f8d559977f4ebd32028a93063f64c8fbeac5b /Src/Zle/compctl.c
parent5096ed276a3f0f3c71e99124db3da0fe32770c12 (diff)
downloadzsh-767eb17ee0a6be853be30cfc0a9ac3c6774eee23.tar.gz
zsh-767eb17ee0a6be853be30cfc0a9ac3c6774eee23.tar.xz
zsh-767eb17ee0a6be853be30cfc0a9ac3c6774eee23.zip
zsh-workers/9746
Diffstat (limited to 'Src/Zle/compctl.c')
-rw-r--r--Src/Zle/compctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index e8d71497d..2f2e298e6 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -1837,7 +1837,7 @@ ccmakehookfn(Hookdef dummy, struct ccmakedat *dat)
 		for (n = firstnode(ccused); n; incnode(n))
 		    addlinknode(lastccused, getdata(n));
 	    } LASTALLOC;
-	} else
+	} else if (ccused)
 	    for (n = firstnode(ccused); n; incnode(n))
 		if (((Compctl) getdata(n)) != &cc_dummy)
 		    freecompctl((Compctl) getdata(n));
@@ -2497,6 +2497,8 @@ static void
 makecomplistcc(Compctl cc, char *s, int incmd)
 {
     cc->refc++;
+    if (!ccused)
+	ccused = newlinklist();
     addlinknode(ccused, cc);
 
     ccont = 0;
@@ -2955,11 +2957,13 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 
     ccont |= (cc->mask2 & (CC_CCCONT | CC_DEFCONT | CC_PATCONT));
 
-    if (incompfunc != 1 && findnode(ccstack, cc))
+    if (incompfunc != 1 && ccstack && findnode(ccstack, cc))
 	return;
 
     MUSTUSEHEAP("complistflags");
 
+    if (!ccstack)
+	ccstack = newlinklist();
     addlinknode(ccstack, cc);
 
     if (incompfunc != 1 && allccs) {