summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-03-06 15:10:27 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2016-03-06 15:10:27 -0800
commitbc958ab27591f3bb717efeb95fa541ee14a2405b (patch)
tree1a0212d6e3d98fe1276c5692ccfd5379d62dcb82
parent440c6beec09b3b4ba68955d807d48acef0d4360a (diff)
downloadzsh-bc958ab27591f3bb717efeb95fa541ee14a2405b.tar.gz
zsh-bc958ab27591f3bb717efeb95fa541ee14a2405b.tar.xz
zsh-bc958ab27591f3bb717efeb95fa541ee14a2405b.zip
38106: if...then if...else should be a parse error.
-rw-r--r--ChangeLog2
-rw-r--r--Src/parse.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 734d685fa..b9d34e430 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2016-03-06  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* 38106: Src/parse.c: if...then if...else should be a parse error.
+
 	* Greg Klanderman: 38086: Doc/Zsh/params.yo, Src/init.c,
 	Src/params.c: shuffle init code to localize a global, add
 	$ZSH_ARGZERO, refine $ZSH_SCRIPT
diff --git a/Src/parse.c b/Src/parse.c
index 628a9aa2d..349d1e427 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -1413,7 +1413,7 @@ par_if(int *cmplx)
 	}
     }
     cmdpop();
-    if (xtok == ELSE) {
+    if (xtok == ELSE || tok == ELSE) {
 	pp = ecadd(0);
 	cmdpush(CS_ELSE);
 	while (tok == SEPER)