From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28709 invoked from network); 26 Mar 2003 17:52:18 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Mar 2003 17:52:18 -0000 Received: (qmail 7021 invoked by alias); 26 Mar 2003 17:52:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18392 Received: (qmail 7010 invoked from network); 26 Mar 2003 17:52:09 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 26 Mar 2003 17:52:09 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 26 Mar 2003 17:52:7 -0000 Received: from exchange01.csr.com (unverified) by (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Wed, 26 Mar 2003 18:00:13 +0000 Received: from csr.com (tinky-winky.csr.com [192.168.144.127]) by exchange01.csr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id G0TVKM6G; Wed, 26 Mar 2003 17:51:26 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: bug in read builtin and Re: PATCH: extra loop tests In-reply-to: "Oliver Kiddle"'s message of "Wed, 26 Mar 2003 18:24:39 +0100." <2861.1048699479@finches.logica.co.uk> Date: Wed, 26 Mar 2003 17:52:05 +0000 Message-ID: <10110.1048701125@csr.com> From: Peter Stephenson Oliver Kiddle wrote: > In adding tests for read (to cover the > new read -d), I found that read -t 1 -p causes a seg fault: I think this test needs to be in other places, but the logic in bin_read() is a bit tortuous. Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.97 diff -u -r1.97 builtin.c --- Src/builtin.c 17 Feb 2003 10:08:03 -0000 1.97 +++ Src/builtin.c 26 Mar 2003 17:50:28 -0000 @@ -4212,7 +4212,8 @@ timeout = (zlong)mn.u.l * (zlong)1000000; } } - if (!read_poll(readfd, &readchar, keys && !zleactive, timeout)) { + if (readfd == -1 || + !read_poll(readfd, &readchar, keys && !zleactive, timeout)) { if (OPT_ISSET(ops,'k') && !zleactive && !isem) settyinfo(&shttyinfo); if (haso) { -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** 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. **********************************************************************