summaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
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++;
+ }
}
}