Skip to content

Commit

Permalink
Sync with OpenBSD
Browse files Browse the repository at this point in the history
CVSROOT:	/cvs
Module name:	src
Changes by:	[email protected]	2021/07/05 07:41:46

Modified files:
	bin/ksh        : syn.c

Log message:
Do not permit an empty list between "while" and "do".
This avoids a cpu loop for "while do done" and is consistent with
the behavior of AT&T ksh and most other shells.  OK jca@ halex@
  • Loading branch information
ibara committed Jul 5, 2021
1 parent 7a5f8be commit be763a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion syn.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: syn.c,v 1.39 2018/04/24 08:25:16 kn Exp $ */
/* $OpenBSD: syn.c,v 1.40 2021/07/05 13:41:46 millert Exp $ */

/*
* shell parser (C version)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit be763a7

Please sign in to comment.