From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2515 invoked from network); 6 Mar 2002 19:21:02 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 6 Mar 2002 19:21:02 -0000 Received: (qmail 3928 invoked by alias); 6 Mar 2002 19:20:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16773 Received: (qmail 3915 invoked from network); 6 Mar 2002 19:20:54 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Core dump on completion after `for' Date: Wed, 06 Mar 2002 19:19:36 +0000 Message-ID: <7819.1015442376@csr.com> From: Peter Stephenson % ./zsh -f % for f in zsh: segmentation fault (core dumped) ./zsh -f It's at the first sprintf in the following in get_comp_string(). tok is 51, which is FOR, which is out of range for tokstrings, which only handles tokens looking like punctuation. if (inredir) { rdstr = rdstrbuf; if (tokfd >= 0) sprintf(rdop, "%d%s", tokfd, tokstrings[tok]); else strcpy(rdop, tokstrings[tok]); strcpy(rdstr, rdop); } We've got to this branch because redir is set for special commands which take lists in ctxtlex(): if (IS_REDIROP(tok) || tok == FOR || tok == FOREACH || tok == SELECT) { inredir = 1; ... so there are two ways to handle it: make these three tokens special cases of redirections, or simply ignore the inredir flag for them. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************