]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Formerly read.c.~32~
authorRoland McGrath <roland@redhat.com>
Thu, 11 Jun 1992 02:07:33 +0000 (02:07 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 11 Jun 1992 02:07:33 +0000 (02:07 +0000)
read.c

diff --git a/read.c b/read.c
index bc0283bbc7055fcb82557447046806062a7c6bc3..2c7cc8964123fb5624f089e88ac00f8adeb7cc62 100644 (file)
--- a/read.c
+++ b/read.c
@@ -794,11 +794,17 @@ conditional_line (line, filename, lineno)
        xrealloc (conditionals->ignoring, conditionals->max_ignoring);
     }
 
-  if (conditionals->if_cmds > 1 &&
-      conditionals->ignoring[conditionals->if_cmds - 2])
-    /* We are already ignoring, so just push a level
-       to match the next "else" or "endif", and keep ignoring.  */
-    conditionals->ignoring[conditionals->if_cmds - 1] = 1;
+  /* Search through the stack to see if we're already ignoring.  */
+  for (i = 0; i < conditionals->if_cmds; ++i)
+    if (conditionals->ignoring[i])
+      {
+       /* We are already ignoring, so just push a level
+          to match the next "else" or "endif", and keep ignoring.
+          We don't want to expand variables in the condition.  */
+       conditionals->ignoring[conditionals->if_cmds - 1] = 1;
+       return 1;
+      }
+
   else if (cmdname[notdef ? 3 : 2] == 'd')
     {
       /* "Ifdef" or "ifndef".  */