From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1373 invoked from network); 29 Mar 2001 11:28:09 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Mar 2001 11:28:09 -0000 Received: (qmail 25714 invoked by alias); 29 Mar 2001 11:28:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13838 Received: (qmail 25702 invoked from network); 29 Mar 2001 11:28:00 -0000 Message-ID: To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Bugs on SourceForge In-Reply-To: Your message of "Thu, 29 Mar 2001 06:53:34 -0000." <1010329065334.ZM17730@candle.brasslantern.com> Date: Thu, 29 Mar 2001 12:27:35 +0100 From: Peter Stephenson > We should at least address 219457 and 219459 before 4.0.1, not because I > submitted them, but because they're shell-crashers. This should fix any lurking problems with %m in a prompt crashing the shell. We don't assume we can write to the return value of getsparam() any more, which probably wasn't a good assumption at the best of times. This is general enough that I haven't looked further down, but I would assume that we were getting back a "", which gcc would have put in the text segment, but behaviour with other compilers would differ. Hence the variable experiences. Index: Src/prompt.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/prompt.c,v retrieving revision 1.4 diff -u -r1.4 prompt.c --- Src/prompt.c 2001/01/16 13:44:20 1.4 +++ Src/prompt.c 2001/03/29 11:18:23 @@ -392,10 +392,7 @@ for (ss = hostnam; *ss; ss++) if (*ss == '.' && !--arg) break; - t0 = *ss; - *ss = '\0'; - stradd(hostnam); - *ss = t0; + stradd(*ss ? dupstrpfx(hostnam, ss - hostnam) : hostnam); } unqueue_signals(); break; -- Peter Stephenson Software Engineer CSR Ltd., Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070