mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 17:24:50 +01:00
23553: bit missed out
This commit is contained in:
parent
1e77d338fb
commit
c2c50bd0a0
3 changed files with 15 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
2007-06-15 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 23553: Doc/Zsh/arith.yo, Doc/Zsh/builtins.yo: was missed out.
|
||||
* 23553: Doc/Zsh/arith.yo, Doc/Zsh/builtins.yo, Src/math.c:
|
||||
should have been committed but wasn't.
|
||||
|
||||
2007-06-14 Peter Stephenson <pws@csr.com>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ matching `tt(RPAR()RPAR())' are treated as a quoted expression and
|
|||
arithmetic expansion performed as for an argument of tt(let). More
|
||||
precisely, `tt(LPAR()LPAR())var(...)tt(RPAR()RPAR())' is equivalent to
|
||||
`tt(let ")var(...)tt(")'. The return status is 0 if the arithmetic value
|
||||
of the expression is non-zero, and 1 otherwise.
|
||||
of the expression is non-zero, 1 if it is zero, and 2 if an error occurred.
|
||||
|
||||
For example, the following statement
|
||||
|
||||
|
|
13
Src/math.c
13
Src/math.c
|
@ -1061,8 +1061,19 @@ mathevall(char *s, int prek, char **ep)
|
|||
"BUG: math: wallabies roaming too freely in outback");
|
||||
|
||||
if (errflag) {
|
||||
/*
|
||||
* This used to set the return value to errflag.
|
||||
* I don't understand how that could be useful; the
|
||||
* caller doesn't know that's what's happened and
|
||||
* may not get a value at all.
|
||||
* Worse, we reset errflag in execarith() and setting
|
||||
* this explicitly non-zero means a (( ... )) returns
|
||||
* status 0 if there's an error. That surely can't
|
||||
* be right. execarith() now detects an error and returns
|
||||
* status 2.
|
||||
*/
|
||||
ret.type = MN_INTEGER;
|
||||
ret.u.l = errflag;
|
||||
ret.u.l = 0;
|
||||
} else {
|
||||
if (stack[0].val.type == MN_UNSET)
|
||||
ret = getnparam(stack[0].lval);
|
||||
|
|
Loading…
Reference in a new issue