about summary refs log tree commit diff
path: root/Src/Zle/compctl.c
diff options
context:
space:
mode:
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) {