zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Re: hash completion bug?
@ 2001-01-16 12:37 Sven Wischnowsky
  0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2001-01-16 12:37 UTC (permalink / raw)
  To: zsh-workers


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@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-16 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-16 12:37 PATCH: Re: hash completion bug? Sven Wischnowsky

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).