do not fail build if MAXSYMLINKS isn't defined
[oweals/busybox.git] / shell / math.c
index 9d3b912a730de6217cb5b2fd95429c71d28ba3ba..3da151137ad4c593b875ec8d4d6f1068595eddad 100644 (file)
@@ -410,7 +410,7 @@ arith_apply(arith_state_t *math_state, operator op, var_or_num_t *numstack, var_
                                return "exponent less than 0";
                        c = 1;
                        while (--right_side_val >= 0)
-                           c *= rez;
+                               c *= rez;
                        rez = c;
                }
                else if (right_side_val == 0)
@@ -494,18 +494,6 @@ static const char op_tokens[] ALIGN1 = {
 };
 #define ptr_to_rparen (&op_tokens[sizeof(op_tokens)-7])
 
-const char* FAST_FUNC
-endofname(const char *name)
-{
-       if (!is_name(*name))
-               return name;
-       while (*++name) {
-               if (!is_in_name(*name))
-                       break;
-       }
-       return name;
-}
-
 static arith_t FAST_FUNC
 evaluate_string(arith_state_t *math_state, const char *expr)
 {
@@ -652,10 +640,10 @@ evaluate_string(arith_state_t *math_state, const char *expr)
                 * integer stack.
                 * But for binary operators, "apply" everything on the operator
                 * stack until we find an operator with a lesser priority than the
-                * one we have just extracted.
+                * one we have just extracted. If op is right-associative,
+                * then stop "applying" on the equal priority too.
                 * Left paren is given the lowest priority so it will never be
                 * "applied" in this way.
-                * if associativity is right and priority eq, applied also skip
                 */
                prec = PREC(op);
                if ((prec > 0 && prec < UNARYPREC) || prec == SPEC_PREC) {