From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7410 invoked from network); 21 Nov 2001 18:35:54 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 21 Nov 2001 18:35:54 -0000 Received: (qmail 20303 invoked by alias); 21 Nov 2001 18:35:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16269 Received: (qmail 20289 invoked from network); 21 Nov 2001 18:35:46 -0000 From: Bart Schaefer Message-Id: <1011121183520.ZM2506@candle.brasslantern.com> Date: Wed, 21 Nov 2001 18:35:19 +0000 In-Reply-To: <7D865FB0D0A1D5118B6E000347055BBB148483@G9JNT.mgb01.telekom.de> Comments: In reply to "Wischnowsky, Sven" "Re: [bug report] 4.0.2 / 4.0.4 dumps core" (Nov 15, 9:16am) References: <7D865FB0D0A1D5118B6E000347055BBB148483@G9JNT.mgb01.telekom.de> X-Mailer: Z-Mail (5.0.0 30July97) To: "Wischnowsky, Sven" , zsh-workers@sunsite.dk Subject: Re: [bug report] 4.0.2 / 4.0.4 dumps core MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 15, 9:16am, Wischnowsky, Sven wrote: } } > > schaefer[524] Src/zsh -f } > > zagzig% setopt extendedglob globcomplete nobanghist } > > zagzig% !^zsh: segmentation fault (core dumped) Src/zsh -f } } Here's that patch. } } Bye } Sven } } diff -ur ../oz/Src/hashtable.c ./Src/hashtable.c } --- ../oz/Src/hashtable.c Tue Nov 13 19:13:45 2001 } +++ ./Src/hashtable.c Tue Nov 13 19:26:12 2001 } @@ -975,7 +975,7 @@ } reswdtab->printnode = printreswdnode; } } for (rw = reswds; rw->nam; rw++) } - reswdtab->addnode(reswdtab, rw->nam, rw); } + reswdtab->addnode(reswdtab, ztrdup(rw->nam), rw); } } } } /* Print a reserved word */ }-- End of excerpt from Wischnowsky, Sven I'm wondering if it wouldn't be more appropriate to duplicate the strings in compctl.c:dumphashtable() rather than simply allowing the completion code to poke bytes into the real reswdtab. E.g.: Index: Src/Zle/compctl.c =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/Zle/compctl.c,v retrieving revision 1.2 diff -c -r1.2 compctl.c --- Src/Zle/compctl.c 2001/04/10 16:37:32 1.2 +++ Src/Zle/compctl.c 2001/11/21 17:00:03 @@ -2096,7 +2096,7 @@ for (i = 0; i < ht->hsize; i++) for (hn = ht->nodes[i]; hn; hn = hn->next) - addmatch(hn->nam, (char *) hn); + addmatch(dupstring(hn->nam), (char *) hn); } /* ScanFunc used by maketildelist() et al. */ -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net