From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7934 invoked from network); 22 Nov 2001 17:57:13 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 22 Nov 2001 17:57:13 -0000 Received: (qmail 27619 invoked by alias); 22 Nov 2001 17:57:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16279 Received: (qmail 27604 invoked from network); 22 Nov 2001 17:57:02 -0000 From: Bart Schaefer Message-Id: <1011122175643.ZM3680@candle.brasslantern.com> Date: Thu, 22 Nov 2001 17:56:43 +0000 In-Reply-To: <7D865FB0D0A1D5118B6E000347055BBB14848B@G9JNT.mgb01.telekom.de> Comments: In reply to "Wischnowsky, Sven" "Re: [bug report] 4.0.2 / 4.0.4 dumps core" (Nov 22, 9:09am) References: <7D865FB0D0A1D5118B6E000347055BBB14848B@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 22, 9:09am, Wischnowsky, Sven wrote: } } Bart wrote: } } > I'm wondering if it wouldn't be more appropriate to duplicate the } > strings in compctl.c:dumphashtable() } } Yes, I thought about doing that, too, and I don't really care where } we put that ztrdup(). It's a matter of the principle that code that's only examining the contents of a data structure shouldn't be changing those contents, even if it restores them afterwards. } > rather than simply allowing the completion code to poke bytes into } > the real reswdtab. } } But it isn't the completion code. At least not for me. It SEGVed in } the pattern matching code (called from the completion code). Yes, but it's the completion code that's "violating" the pattern match code API, in the sense that the pattern match code is supposed to get writable strings and the completion code isn't providing them. } And I was tempted to change that code to at least test if it was } trying to write a '\0' onto the Null-byte at the end of a string. That would unnecessarily penalize every other caller of the pattern match code, wouldn't it? If there's no problem with using dupstring() in dumphashtable(), then I'd prefer to commit my patch rather than yours. -- 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