diff options
author | Paul Smith <psmith@gnu.org> | 2003-11-04 07:40:29 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2003-11-04 07:40:29 +0000 |
commit | 272015661ecc9a21a28db36f7232bea29af051e4 (patch) | |
tree | 0cedbb4ac47a4a0dcd49bd80c4b0ceadf8bed80d /expand.c | |
parent | f654a8521c7d81b986cf4a569b44a8d91bba1c2b (diff) | |
download | make-272015661ecc9a21a28db36f7232bea29af051e4.tar.gz |
Fix bugs 5798 and 6195.
Diffstat (limited to 'expand.c')
-rw-r--r-- | expand.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -97,6 +97,7 @@ recursively_expand_for_file (struct variable *v, struct file *file) { char *value; struct variable_set_list *save = 0; + int set_reading = 0; if (v->expanding) { @@ -114,6 +115,13 @@ 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 = &v->fileinfo; + } + v->expanding = 1; if (v->append) value = allocated_variable_append (v); @@ -121,6 +129,8 @@ recursively_expand_for_file (struct variable *v, struct file *file) value = allocated_variable_expand (v->value); v->expanding = 0; + if (set_reading) + reading_file = 0; if (file) current_variable_set_list = save; |