diff options
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/math.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/shell/math.c b/shell/math.c index 4623c979e..a398bcb98 100644 --- a/shell/math.c +++ b/shell/math.c | |||
| @@ -345,7 +345,7 @@ arith_apply(arith_state_t *math_state, operator op, var_or_num_t *numstack, var_ | |||
| 345 | rez++; | 345 | rez++; |
| 346 | else if (op == TOK_POST_DEC || op == TOK_PRE_DEC) | 346 | else if (op == TOK_POST_DEC || op == TOK_PRE_DEC) |
| 347 | rez--; | 347 | rez--; |
| 348 | else if (op != TOK_UPLUS) { | 348 | else /*if (op != TOK_UPLUS) - always true, we drop TOK_UPLUS earlier */ { |
| 349 | /* Binary operators */ | 349 | /* Binary operators */ |
| 350 | arith_t right_side_val; | 350 | arith_t right_side_val; |
| 351 | 351 | ||
| @@ -770,8 +770,10 @@ evaluate_string(arith_state_t *math_state, const char *expr) | |||
| 770 | if (lasttok != TOK_NUM) { | 770 | if (lasttok != TOK_NUM) { |
| 771 | switch (op) { | 771 | switch (op) { |
| 772 | case TOK_ADD: | 772 | case TOK_ADD: |
| 773 | op = TOK_UPLUS; | 773 | //op = TOK_UPLUS; |
| 774 | break; | 774 | //break; |
| 775 | /* Unary plus does nothing, do not even push it to opstack */ | ||
| 776 | continue; | ||
| 775 | case TOK_SUB: | 777 | case TOK_SUB: |
| 776 | op = TOK_UMINUS; | 778 | op = TOK_UMINUS; |
| 777 | break; | 779 | break; |
