shell/math: better comment. no code changes
authorDenys Vlasenko <dvlasenk@redhat.com>
Fri, 17 Sep 2010 16:02:17 +0000 (18:02 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Fri, 17 Sep 2010 16:02:17 +0000 (18:02 +0200)
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
shell/math.c

index 9d3b912a730de6217cb5b2fd95429c71d28ba3ba..760645d0f91585bd4781f16d95004ec72c97877b 100644 (file)
@@ -652,10 +652,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) {