diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2007-06-15 10:02:24 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-06-15 10:02:24 +0000 |
| commit | c2c50bd0a0778217d18ebe7ed36bbb88985a9736 (patch) | |
| tree | 196fbe95de2b8769c7e01140048462713909f3e7 /Src/math.c | |
| parent | 23553: bit missed out (diff) | |
| download | zsh-c2c50bd0a0778217d18ebe7ed36bbb88985a9736.tar zsh-c2c50bd0a0778217d18ebe7ed36bbb88985a9736.tar.gz zsh-c2c50bd0a0778217d18ebe7ed36bbb88985a9736.tar.bz2 zsh-c2c50bd0a0778217d18ebe7ed36bbb88985a9736.tar.lz zsh-c2c50bd0a0778217d18ebe7ed36bbb88985a9736.tar.xz zsh-c2c50bd0a0778217d18ebe7ed36bbb88985a9736.tar.zst zsh-c2c50bd0a0778217d18ebe7ed36bbb88985a9736.zip | |
23553: bit missed out
Diffstat (limited to 'Src/math.c')
| -rw-r--r-- | Src/math.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Src/math.c b/Src/math.c index 66d57fd53..e1cde5f03 100644 --- a/Src/math.c +++ b/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); |
