summary refs log tree commit diff
diff options
context:
space:
mode:
-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)