summaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2006-09-01 23:48:25 +0000
committerIan C <ianc@noddybox.co.uk>2006-09-01 23:48:25 +0000
commit37141ac197eaefeae9dada0bcc1c429ff584df44 (patch)
tree6bd93dbf3735d22e9dadb9d41ae1c68b980d0c0e /expr.c
parent025fbd0c161c8f528e20f034d84ad986a4ebef36 (diff)
GEMMA largely working. Fixed broken expressions with white space.
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/expr.c b/expr.c
index 9369e1d..6cd8237 100644
--- a/expr.c
+++ b/expr.c
@@ -436,23 +436,30 @@ static Stack *ToPostfix(const char *expr)
}
else
{
- /* Found an operand - parse and store the operand
- */
- p=buff;
-
- while(*expr && !IS_OPERAND_END(*expr))
+ if (!isspace(*expr))
{
- *p++=*expr++;
- }
+ /* Found an operand - parse and store the operand
+ */
+ p=buff;
- *p=0;
+ while(*expr && !IS_OPERAND_END(*expr))
+ {
+ *p++=*expr++;
+ }
- /* Note that operands are marked as unary just to chose one over
- the other branch in EvalPostfix() - no other reason
- */
- output=Push(output,TYPE_OPERAND,0,TRUE,buff);
+ *p=0;
- prev_was_op=FALSE;
+ /* Note that operands are marked as unary just to chose one over
+ the other branch in EvalPostfix() - no other reason
+ */
+ output=Push(output,TYPE_OPERAND,0,TRUE,buff);
+
+ prev_was_op=FALSE;
+ }
+ else
+ {
+ expr++;
+ }
}
}