Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: return status of let with floats
- X-seq: zsh-workers 18015
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: return status of let with floats
- Date: Wed, 18 Dec 2002 18:01:02 +0000
- In-reply-to: "Oliver Kiddle"'s message of "Wed, 18 Dec 2002 18:26:15 +0100." <1808.1040232375@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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 <pws@xxxxxxx> 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.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author