← Commit list

ab80e01cd

Ron Yorston
Ron Yorston
2015-10-29
SUCCESS Duration: 189s

Subject

ash: allow newline after variable name in for loop

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash.c+2 -2
@@ -10913,7 +10913,7 @@ parse_command(void)
n1 = stzalloc(sizeof(struct nfor));
n1->type = NFOR;
n1->nfor.var = wordtext;
- checkkwd = CHKKWD | CHKALIAS;
+ checkkwd = CHKNL | CHKKWD | CHKALIAS;
if (readtoken() == TIN) {
app = ≈
while (readtoken() == TWORD) {
@@ -10940,7 +10940,7 @@ parse_command(void)
* Newline or semicolon here is optional (but note
* that the original Bourne shell only allowed NL).
*/
- if (lasttoken != TNL && lasttoken != TSEMI)
+ if (lasttoken != TSEMI)
tokpushback = 1;
}
checkkwd = CHKNL | CHKKWD | CHKALIAS;
shell/ash_test/ash-misc/for.right+1 -0
@@ -0,0 +1 @@
+OK
shell/ash_test/ash-misc/for.tests+5 -0
@@ -0,0 +1,5 @@
+for i
+in OK
+do
+ echo $i
+done