summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-10-26 16:06:30 +0000
committerPaul Smith <psmith@gnu.org>2005-10-26 16:06:30 +0000
commit82103b1a49394a7063f8cddfc89f759ddf847de9 (patch)
tree09c74c9e3caf9d6ed43e60053fb878010258d137 /read.c
parent11095a90f120545c915c92b8ebf48f04723d1837 (diff)
downloadgunmake-82103b1a49394a7063f8cddfc89f759ddf847de9.tar.gz
Fix a crash I introduced last-minute.
Try to avoid extraneous rebuilds of template files.
Diffstat (limited to 'read.c')
-rw-r--r--read.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/read.c b/read.c
index bad07eb..9fbfd35 100644
--- a/read.c
+++ b/read.c
@@ -1969,7 +1969,8 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent,
the last one. It is not safe for the same deps to go in more
than one place in the database. */
this = nextf != 0 ? copy_dep_chain (deps) : deps;
- this->need_2nd_expansion = second_expansion;
+ this->need_2nd_expansion = (second_expansion
+ && strchr (this->name, '$'));
}
if (!two_colon)
@@ -2129,9 +2130,12 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent,
{
targets[target_idx] = 0;
target_percents[target_idx] = 0;
- deps->need_2nd_expansion = second_expansion;
- /* We set this to indicate we've not yet parsed the prereq string. */
- deps->staticpattern = 1;
+ if (deps)
+ {
+ deps->need_2nd_expansion = second_expansion;
+ /* We set this to indicate the prereq string hasn't been parsed. */
+ deps->staticpattern = 1;
+ }
create_pattern_rule (targets, target_percents, two_colon, deps, cmds, 1);
free ((char *) target_percents);
}