changeset 72:b1d0f10e8d36

handle nested ifs correctly
author David A. Holland
date Mon, 10 Jun 2013 16:20:33 -0400
parents dc63e70e425d
children d122b4553150
files directive.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/directive.c	Mon Jun 10 16:05:42 2013 -0400
+++ b/directive.c	Mon Jun 10 16:20:33 2013 -0400
@@ -138,7 +138,14 @@
 void
 ifstate_push(struct place *p, bool startstate)
 {
-	ifstate = ifstate_create(ifstate, p, startstate);
+	struct ifstate *newstate;
+
+	newstate = ifstate_create(ifstate, p, startstate);
+	if (!ifstate->curtrue) {
+		newstate->curtrue = false;
+		newstate->evertrue = true;
+	}
+	ifstate = newstate;
 }
 
 static