From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8147 invoked from network); 18 Dec 2002 18:01:37 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 18 Dec 2002 18:01:37 -0000 Received: (qmail 11912 invoked by alias); 18 Dec 2002 18:01:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18015 Received: (qmail 11899 invoked from network); 18 Dec 2002 18:01:30 -0000 To: zsh-workers@sunsite.dk Subject: Re: PATCH: return status of let with floats In-reply-to: "Oliver Kiddle"'s message of "Wed, 18 Dec 2002 18:26:15 +0100." <1808.1040232375@finches.logica.co.uk> Date: Wed, 18 Dec 2002 18:01:02 +0000 Message-ID: <22287.1040234462@csr.com> From: Peter Stephenson Oliver Kiddle wrote: > All of bash, pdksh and ksh 88/93 output 0 for `echo $(( ))' by the way > while zsh gives a bad math expression error so that should perhaps also > be changed. This handles that particular case, though I don't know if it's supposed to be something more general. Index: Src/math.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/math.c,v retrieving revision 1.16 diff -u -r1.16 math.c --- Src/math.c 30 Oct 2002 19:29:42 -0000 1.16 +++ Src/math.c 18 Dec 2002 17:58:44 -0000 @@ -961,7 +961,7 @@ stack[0].val.u.l = 0; mathparse(prek); *ep = ptr; - DPUTS(!errflag && sp, + DPUTS(!errflag && sp > 0, "BUG: math: wallabies roaming too freely in outback"); if (errflag) { @@ -1084,6 +1084,9 @@ if (errflag) return; mtok = zzlex(); + /* Handle empty input */ + if (pc == TOPPREC && mtok == EOI) + return; checkunary(mtok, optr); while (prec[mtok] <= pc) { if (errflag) -- 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. **********************************************************************