--- make-3.81beta4/expand.c 2005-07-11 21:35:13.000000000 -0700 +++ make-3.81beta4-new/expand.c 2006-02-07 15:34:33.000000000 -0800 @@ -97,7 +97,7 @@ { char *value; struct variable_set_list *save = 0; - int set_reading = 0; + const struct floc *prev_reading_file; if (v->expanding) { @@ -115,12 +115,8 @@ 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; - } + prev_reading_file = reading_file; // Save off current file location + reading_file = &v->fileinfo; v->expanding = 1; if (v->append) @@ -129,8 +125,8 @@ value = allocated_variable_expand (v->value); v->expanding = 0; - if (set_reading) - reading_file = 0; + reading_file = prev_reading_file; + if (file) current_variable_set_list = save;