Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: hash completion bug?
- X-seq: zsh-workers 13364
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: hash completion bug?
- Date: Tue, 16 Jan 2001 13:37:45 +0100 (MET)
- In-reply-to: Hiroki Tamakoshi's message of 16 Jan 2001 21:03:21 +0900
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Hiroki Tamakoshi wrote:
> % zsh -f
> % typeset -A foo
> % foo[TAB
> cause segmentation fault.
Urgh. compctl.
Better test if there is already a hashtable before trying to use it.
Bye
Sven
Index: Src/Zle/compctl.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compctl.c,v
retrieving revision 1.7
diff -u -r1.7 compctl.c
--- Src/Zle/compctl.c 2000/06/22 08:42:37 1.7
+++ Src/Zle/compctl.c 2001/01/16 12:37:05
@@ -3749,7 +3749,10 @@
dumphashtable(aliastab, t | (cc->mask & (CC_DISCMDS|CC_EXCMDS)));
if (keypm && cc == &cc_dummy) {
/* Add the keys of the parameter in keypm. */
- scanhashtable(keypm->gets.hfn(keypm), 0, 0, PM_UNSET, addhnmatch, 0);
+ HashTable t = keypm->gets.hfn(keypm);
+
+ if (t)
+ scanhashtable(t, 0, 0, PM_UNSET, addhnmatch, 0);
keypm = NULL;
cc_dummy.suffix = NULL;
}
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author