diff options
author | Ian C <ianc@noddybox.co.uk> | 2006-09-01 23:48:25 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2006-09-01 23:48:25 +0000 |
commit | 37141ac197eaefeae9dada0bcc1c429ff584df44 (patch) | |
tree | 6bd93dbf3735d22e9dadb9d41ae1c68b980d0c0e /expr.c | |
parent | 025fbd0c161c8f528e20f034d84ad986a4ebef36 (diff) |
GEMMA largely working. Fixed broken expressions with white space.
Diffstat (limited to 'expr.c')
-rw-r--r-- | expr.c | 33 |
1 files changed, 20 insertions, 13 deletions
@@ -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++; + } } } |