about summary refs log tree commit diff
path: root/Src/math.c
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2013-04-30 00:18:13 -0700
committerBart Schaefer <schaefer@zsh.org>2013-04-30 00:18:13 -0700
commitf4b083327064c122945901736c19f381d3f67499 (patch)
treeaf52ccc167ac7b0aa7644ad19b3504dcd43e966b /Src/math.c
parenta700c61c77618ca328599fe61ab078962b7b5196 (diff)
downloadzsh-f4b083327064c122945901736c19f381d3f67499.tar.gz
zsh-f4b083327064c122945901736c19f381d3f67499.tar.xz
zsh-f4b083327064c122945901736c19f381d3f67499.zip
31353: fix handling of floating point in ternary
Diffstat (limited to 'Src/math.c')
-rw-r--r--Src/math.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/math.c b/Src/math.c
index a2462a32e..eae283d19 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -1459,7 +1459,8 @@ mathparse(int pc)
 	case QUEST:
 	    if (stack[sp].val.type == MN_UNSET)
 		stack[sp].val = getmathparam(stack + sp);
-	    q = (stack[sp].val.type == MN_FLOAT) ? (zlong)stack[sp].val.u.d :
+	    q = (stack[sp].val.type == MN_FLOAT) ?
+		(stack[sp].val.u.d == 0 ? 0 : 1) :
 		stack[sp].val.u.l;
 
 	    if (!q)