diff options
-rw-r--r-- | shell/ash.c | 4 | ||||
-rw-r--r-- | shell/ash_test/ash-misc/for.right | 1 | ||||
-rwxr-xr-x | shell/ash_test/ash-misc/for.tests | 5 |
3 files changed, 8 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index 17121aa..3339666 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -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; diff --git a/shell/ash_test/ash-misc/for.right b/shell/ash_test/ash-misc/for.right new file mode 100644 index 0000000..d86bac9 --- /dev/null +++ b/shell/ash_test/ash-misc/for.right @@ -0,0 +1 @@ +OK diff --git a/shell/ash_test/ash-misc/for.tests b/shell/ash_test/ash-misc/for.tests new file mode 100755 index 0000000..4889a9f --- /dev/null +++ b/shell/ash_test/ash-misc/for.tests @@ -0,0 +1,5 @@ +for i +in OK +do + echo $i +done |