Description: Fix arithmetic precedence for consecutive ADDOP or MULOP
Author: Gilles Filippini <pini@debian.org>
Bug-Debian: https://bugs.debian.org/862221
Index: csh-20110502/exp.c
===================================================================
--- csh-20110502.orig/exp.c
+++ csh-20110502/exp.c
@@ -317,10 +317,10 @@ exp4(Char ***vp, bool ignore)
 #ifdef EDEBUG
     etracc("exp4 p1", p1, vp);
 #endif
-    if (isa(**vp, ADDOP)) {
+    while (isa(**vp, ADDOP)) {
 	Char *op = *(*vp)++;
 
-	p2 = exp4(vp, ignore);
+	p2 = exp5(vp, ignore);
 #ifdef EDEBUG
 	etracc("exp4 p2", p2, vp);
 #endif
@@ -337,7 +337,7 @@ exp4(Char ***vp, bool ignore)
 	    }
 	xfree((ptr_t) p1);
 	xfree((ptr_t) p2);
-	return (putn(i));
+	p1 = putn(i);
     }
     return (p1);
 }
@@ -352,10 +352,10 @@ exp5(Char ***vp, bool ignore)
 #ifdef EDEBUG
     etracc("exp5 p1", p1, vp);
 #endif
-    if (isa(**vp, MULOP)) {
+    while (isa(**vp, MULOP)) {
 	Char *op = *(*vp)++;
 
-	p2 = exp5(vp, ignore);
+	p2 = exp6(vp, ignore);
 #ifdef EDEBUG
 	etracc("exp5 p2", p2, vp);
 #endif
@@ -382,7 +382,7 @@ exp5(Char ***vp, bool ignore)
 	    }
 	xfree((ptr_t) p1);
 	xfree((ptr_t) p2);
-	return (putn(i));
+	p1 = putn(i);
     }
     return (p1);
 }
