about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-05-17 15:14:03 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-05-17 15:14:03 +0000
commitcd3578ed9434868fab8da3031e83de5017332205 (patch)
tree5f43853ae9d72f8e5098cf3c3896389dc4e9e375
parentdbe104ca8caa087e889ee83126f99c63110b9482 (diff)
downloadzsh-cd3578ed9434868fab8da3031e83de5017332205.tar.gz
zsh-cd3578ed9434868fab8da3031e83de5017332205.tar.xz
zsh-cd3578ed9434868fab8da3031e83de5017332205.zip
17175: Src/math.c: didn't handle parameters before a ternary expression
properly.
-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;