summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1992-06-11 02:07:33 +0000
committerRoland McGrath <roland@redhat.com>1992-06-11 02:07:33 +0000
commit92dc493189386e40d241a3aa7f3a59c02a5a204e (patch)
tree4ae2bf3c0cdfdf84190ce57090e2797c16296f89 /read.c
parent39f1bf9ce821af4fb6ad92e1a951abd628d07dc9 (diff)
downloadgunmake-92dc493189386e40d241a3aa7f3a59c02a5a204e.tar.gz
Formerly read.c.~32~
Diffstat (limited to 'read.c')
-rw-r--r--read.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/read.c b/read.c
index bc0283b..2c7cc89 100644
--- 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". */