Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Re: seg fault with compstate param



Bart Schaefer wrote:

> On Aug 23,  4:26pm, Bart Schaefer wrote:
> } Subject: Re: seg fault with compstate param
> }
> } On Aug 23, 10:53am, Oliver Kiddle wrote:
> } }
> } } In either 4.0.2 or recentish 4.1 putting the command `typeset compstate'
> } } in a completion function causes it to seg fault.
> } 
> } What you did was declare a local variable named compstate that was not an
> } associative array.
> 
> That's not quite accurate.  The compstate array did retain its special
> properties when made local.  But it was equivalent to `compstate=()',
> which also causes a core dump.

Oops.  Better test if we get a table at all.


Bye
  Sven

Index: Src/Zle/complete.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v
retrieving revision 1.18
diff -u -r1.18 complete.c
--- Src/Zle/complete.c	2001/07/25 14:49:33	1.18
+++ Src/Zle/complete.c	2001/08/24 09:23:46
@@ -1072,6 +1072,9 @@
     struct value v;
     char *str;
 
+    if (!ht)
+        return;
+
     for (i = 0; i < ht->hsize; i++)
 	for (hn = ht->nodes[i]; hn; hn = hn->next)
 	    for (cp = compkparams,

-- 
Sven Wischnowsky                    wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author