From 767eb17ee0a6be853be30cfc0a9ac3c6774eee23 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 15 Feb 2000 12:24:59 +0000 Subject: zsh-workers/9746 --- Src/Zle/compctl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Src/Zle/compctl.c') 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) { -- cgit 1.4.1