ash: remove arithmetic expansion collapsing at parse time
No binary (build failed)
—
(log yok)
| @@ -11316,9 +11316,9 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) | |
| parenlevel--; | |
| } else { | |
| if (pgetc() == ')') { | |
| + | c = CTLENDARI; |
| if (--arinest == 0) { | |
| syntax = prevsyntax; | |
| - | c = CTLENDARI; |
| } | |
| } else { | |
| /* | |
| @@ -11809,18 +11809,12 @@ parsearith: { | |
| if (++arinest == 1) { | |
| prevsyntax = syntax; | |
| syntax = ARISYNTAX; | |
| - | USTPUTC(CTLARI, out); |
| - | if (dblquote) |
| - | USTPUTC('"', out); |
| - | else |
| - | USTPUTC(' ', out); |
| - | } else { |
| - | /* |
| - | * we collapse embedded arithmetic expansion to |
| - | * parenthesis, which should be equivalent |
| - | */ |
| - | USTPUTC('(', out); |
| } | |
| + | USTPUTC(CTLARI, out); |
| + | if (dblquote) |
| + | USTPUTC('"', out); |
| + | else |
| + | USTPUTC(' ', out); |
| goto parsearith_return; | |
| } | |
| #endif | |
| @@ -0,0 +1,2 @@ | |
| + | 12 |
| + | 9 |
| @@ -0,0 +1,3 @@ | |
| + | unset a |
| + | echo $((3 + ${a:=$((4 + 5))})) |
| + | echo $a |