* Re: _normal:26: bad math expression: operator expected at `0 '
[not found] <1188.1019748723@csr.com>
@ 2002-04-25 15:42 ` Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2002-04-25 15:42 UTC (permalink / raw)
To: Zsh hackers list
Peter Stephenson wrote:
> > octalzeroes
One supposes the following feature of this option, which is causing the
problem, is unintended:
% setopt octalzeroes
% print $(( 0 + 0 ))
zsh: bad math expression: operator expected at `0 '
Index: Src/math.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/math.c,v
retrieving revision 1.12
diff -u -r1.12 math.c
--- Src/math.c 14 Jan 2002 13:46:32 -0000 1.12
+++ Src/math.c 25 Apr 2002 15:40:16 -0000
@@ -383,9 +383,10 @@
return NUM;
}
else if (isset(OCTALZEROES) &&
- (memchr(ptr, '.', strlen(ptr)) == NULL)) {
+ (memchr(ptr, '.', strlen(ptr)) == NULL) &&
+ idigit(*ptr)) {
yyval.u.l = zstrtol(ptr, &ptr, lastbase = 8);
- return NUM;
+ return NUM;
}
/* Fall through! */
default:
--
Peter Stephenson <pws@csr.com> 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.
**********************************************************************
^ permalink raw reply [flat|nested] only message in thread