From 493fe2b4440679ca73d9022d94129039b9eacfeb Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 15 Apr 2015 18:14:27 +0100 Subject: unposted: rewrite Nularg math handling to be like other cases --- Src/math.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/math.c b/Src/math.c index 2105180c8..97a97b32b 100644 --- a/Src/math.c +++ b/Src/math.c @@ -1398,7 +1398,9 @@ matheval(char *s) if (!mlevel) outputradix = outputunderscore = 0; - if (!*s || *s == Nularg) { + if (*s == Nularg) + s++; + if (!*s) { x.type = MN_INTEGER; x.u.l = 0; return x; @@ -1435,7 +1437,9 @@ mathevalarg(char *s, char **ss) * * To avoid a more opaque error further in, bail out here. */ - if (!*s || *s == Nularg) { + if (*s == Nularg) + s++; + if (!*s) { zerr("bad math expression: empty string"); return (zlong)0; } -- cgit 1.4.1