about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/math.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 06293ce6e..9927d0c20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-17  Peter Stephenson  <pws@csr.com>
+
+	* 17175: Src/math.c: didn't handle parameters before a ternary
+	expression properly.
+
 2002-05-16  Peter Stephenson  <pws@csr.com>
 
 	* 17171: Src/Modules/tcp.c: ztcp didn't return status 1 when a
diff --git a/Src/math.c b/Src/math.c
index e87a286fb..344670d6e 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -1109,6 +1109,8 @@ mathparse(int pc)
 	    }
 	    break;
 	case QUEST:
+	    if (stack[sp].val.type == MN_UNSET)
+		stack[sp].val = getnparam(stack[sp].lval);
 	    q = (stack[sp].val.type == MN_FLOAT) ? (zlong)stack[sp].val.u.d :
 		stack[sp].val.u.l;