On Sun, 04 Jul 2021 23:25:25 +0200, Alexander Hall wrote: > The "... do done" variant has been frequently used by me, and seems to appear > at least three times in install.sub, so if this goes in, please scan the scr > ipts in our tree first, at least for trivial cases.
Fair enough, let's just require a non-empty expression but still allow an empty loop body. It would be a good idea to call this out as a portability issue in the ksh manual but that can be done separately. - todd Index: bin/ksh/syn.c =================================================================== RCS file: /cvs/src/bin/ksh/syn.c,v retrieving revision 1.39 diff -u -p -u -r1.39 syn.c --- bin/ksh/syn.c 24 Apr 2018 08:25:16 -0000 1.39 +++ bin/ksh/syn.c 4 Jul 2021 22:21:39 -0000 @@ -331,6 +331,8 @@ get_command(int cf) nesting_push(&old_nesting, c); t = newtp((c == WHILE) ? TWHILE : TUNTIL); t->left = c_list(true); + if (t->left == NULL) + syntaxerr(NULL); t->right = dogroup(); nesting_pop(&old_nesting); break;