diff options
author | Paul Smith <psmith@gnu.org> | 2007-06-19 04:47:58 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2007-06-19 04:47:58 +0000 |
commit | a94019907222057e5c2ab6baa6816fcab73c686b (patch) | |
tree | a2681e0b310d732452b899b6091d7d5afe81dbfe /expand.c | |
parent | eda0e24ccdae279a2c12059242ef89a22c274047 (diff) | |
download | gunmake-a94019907222057e5c2ab6baa6816fcab73c686b.tar.gz |
Fix a core dump when reading_file is 0 (20033).
Fix some manual typos (20018).
Diffstat (limited to 'expand.c')
-rw-r--r-- | expand.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -460,20 +460,25 @@ char * variable_expand_for_file (const char *line, struct file *file) { char *result; - struct variable_set_list *save; + struct variable_set_list *savev; + const struct floc *savef; if (file == 0) return variable_expand (line); - save = current_variable_set_list; + savev = current_variable_set_list; current_variable_set_list = file->variables; + + savef = reading_file; if (file->cmds && file->cmds->fileinfo.filenm) reading_file = &file->cmds->fileinfo; else reading_file = 0; + result = variable_expand (line); - current_variable_set_list = save; - reading_file = 0; + + current_variable_set_list = savev; + reading_file = savef; return result; } |