summaryrefslogtreecommitdiff
path: root/expand.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2006-02-20 02:14:00 +0000
committerPaul Smith <psmith@gnu.org>2006-02-20 02:14:00 +0000
commit6e0527913c6724fa92e2135de991e27df54c4289 (patch)
treec9e4c448ae4476e5ef81ca5a5ca8feb344e519c7 /expand.c
parentbde826b18aeb6fd3c9de7a7733d1e163efde90e1 (diff)
downloadgunmake-6e0527913c6724fa92e2135de991e27df54c4289.tar.gz
- Memory cleanups, found with valgrind.
- Fix handling of special targets like .SUFFIX for VMS insensitive targets. - Don't make temporary batch files for -n. Make sure batch files are created in text mode.
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/expand.c b/expand.c
index d25afef..39f0d19 100644
--- a/expand.c
+++ b/expand.c
@@ -113,11 +113,18 @@ recursively_expand_for_file (struct variable *v, struct file *file)
expanding_var = &this_var;
}
+ /* If we have no other file-reading context, use the variable's context. */
+ if (!reading_file)
+ {
+ set_reading = 1;
+ reading_file = &v->fileinfo;
+ }
+
if (v->expanding)
{
if (!v->exp_count)
/* Expanding V causes infinite recursion. Lose. */
- fatal (this_var,
+ fatal (*expanding_var,
_("Recursive variable `%s' references itself (eventually)"),
v->name);
--v->exp_count;
@@ -129,13 +136,6 @@ recursively_expand_for_file (struct variable *v, struct file *file)
current_variable_set_list = file->variables;
}
- /* If we have no other file-reading context, use the variable's context. */
- if (!reading_file)
- {
- set_reading = 1;
- reading_file = this_var;
- }
-
v->expanding = 1;
if (v->append)
value = allocated_variable_append (v);