From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22983 invoked from network); 31 Jul 2003 20:31:20 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 31 Jul 2003 20:31:20 -0000 Received: (qmail 20740 invoked by alias); 31 Jul 2003 20:31:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18916 Received: (qmail 20713 invoked from network); 31 Jul 2003 20:31:14 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 31 Jul 2003 20:31:14 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [195.92.195.175] by sunsite.dk (MessageWall 1.0.8) with SMTP; 31 Jul 2003 20:31:14 -0000 Received: from modem-132.dragonette.dialup.pol.co.uk ([62.137.2.132] helo=pwstephenson.fsnet.co.uk) by cmailg5.svr.pol.co.uk with esmtp (Exim 4.14) id 19iK4u-00056p-Fb for zsh-workers@sunsite.dk; Thu, 31 Jul 2003 21:31:12 +0100 Received: by pwstephenson.fsnet.co.uk (Postfix, from userid 501) id 86ACF8548; Thu, 31 Jul 2003 16:33:19 -0400 (EDT) Received: from pwstephenson.fsnet.co.uk (localhost [127.0.0.1]) by pwstephenson.fsnet.co.uk (Postfix) with ESMTP id 2E2578547 for ; Thu, 31 Jul 2003 21:33:19 +0100 (BST) To: zsh-workers@sunsite.dk Subject: Re: Segfault in completion code In-reply-to: "Haakon Riiser"'s message of "Sun, 27 Jul 2003 03:42:10 +0200." <20030727014210.GA11368@s.chello.no> Date: Thu, 31 Jul 2003 21:33:17 +0100 From: Peter Stephenson Message-Id: <20030731203319.86ACF8548@pwstephenson.fsnet.co.uk> Haakon Riiser wrote: > Steps to reproduce: > > % unset IFS > % > zsh: segmentation fault zsh This fixes a problem, is it the one you came across? Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.51 diff -u -r1.51 utils.c --- Src/utils.c 13 May 2003 12:50:32 -0000 1.51 +++ Src/utils.c 31 Jul 2003 20:25:36 -0000 @@ -2054,10 +2054,12 @@ if (!*s) return heap ? "" : ztrdup(""); if (!sep) { - sep = sepbuf; - sepbuf[0] = *ifs; - sepbuf[1] = *ifs == Meta ? ifs[1] ^ 32 : '\0'; - sepbuf[2] = '\0'; + p = sep = sepbuf; + if (ifs) { + *p++ = *ifs; + *p++ = *ifs == Meta ? ifs[1] ^ 32 : '\0'; + } + *p = '\0'; } sl = strlen(sep); for (t = s, l = 1 - sl; *t; l += strlen(*t) + sl, t++); -- Peter Stephenson Work: pws@csr.com Web: http://www.pwstephenson.fsnet.co.uk