From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28105 invoked from network); 7 Jun 1999 15:50:03 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Jun 1999 15:50:03 -0000 Received: (qmail 18428 invoked by alias); 7 Jun 1999 15:49:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6509 Received: (qmail 18415 invoked from network); 7 Jun 1999 15:49:54 -0000 Message-Id: <9906071521.AA33085@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Bug in completion with menucomplete and no insertion Date: Mon, 07 Jun 1999 17:21:21 +0200 From: Peter Stephenson I was just testing the closing-stdin code and I got a command wrong and it caused a (repeatable) crash. Then I found it works even if I got the command right(ish). What I tried first was % _foo() { compgen -s; } # mistake, of course % compdef _foo foo % foo compgen: command string expected after -s +4:53% foo compgen: command string expected after -s Hitting up arrow and immediately typing any insertion key causes the shell to crash every time. Then I found it did the same with % _foo() { compgen -s ''; } (except it was a little more erratic getting it to crash). Presumably something nasty is happening to memory somewhere before that point. I checked and it's not even specific to -s: other mistakes in the get_compctl() called from bin_compgen() do the same thing. The common factor seems to be that none of the commands produce matches or insert anything. It seems to need menucomplete set as well; I've reproduced it after zsh -f, compinit, setopt nobeep menucomplete (nobeep is only necessary for sanity). Maybe more will turn up after I compile the new version on a system where I can use mem-debug. By the way, I've applied the following trivial patch to zle_tricky.c for shared-library purposes. --- Src/Zle/zle_tricky.c.csu Mon Jun 7 13:29:37 1999 +++ Src/Zle/zle_tricky.c Mon Jun 7 14:43:00 1999 @@ -5077,7 +5077,7 @@ } compquote = ztrdup(compquote); compquoting = ztrdup(compquoting); - comp_setunset(0, 0, set, unset); + comp_setunsetptr(0, 0, set, unset); if (unset(COMPLETEINWORD)) { untokenize(ns); -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy