summaryrefslogtreecommitdiff
path: root/implicit.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-07-20 22:34:41 +0000
committerPaul Smith <psmith@gnu.org>1999-07-20 22:34:41 +0000
commit73846549f62b832ca6ff761ad3640a86d3b32c86 (patch)
tree040672d69082d86fe744ca7157bee5b72147f511 /implicit.c
parent169e6b8c3de0145c61ff2127b7c191d12f069d2b (diff)
downloadgunmake-73846549f62b832ca6ff761ad3640a86d3b32c86.tar.gz
* Fix memory leaks, fd leaks, and some long-standing bugs recognizing when
targets need to have their modtimes rechecked (-n, etc.)
Diffstat (limited to 'implicit.c')
-rw-r--r--implicit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/implicit.c b/implicit.c
index dfe19da..3ed23a3 100644
--- a/implicit.c
+++ b/implicit.c
@@ -524,6 +524,7 @@ pattern_search (file, archive, depth, recursions)
f->deps = imf->deps;
f->cmds = imf->cmds;
f->stem = imf->stem;
+ f->also_make = imf->also_make;
imf = lookup_file (intermediate_patterns[deps_found]);
if (imf != 0 && imf->precious)
f->precious = 1;
@@ -532,6 +533,9 @@ pattern_search (file, archive, depth, recursions)
for (dep = f->deps; dep != 0; dep = dep->next)
{
dep->file = enter_file (dep->name);
+ /* enter_file uses dep->name _if_ we created a new file. */
+ if (dep->name != dep->file->name)
+ free (dep->name);
dep->name = 0;
dep->file->tried_implicit |= dep->changed;
}
@@ -591,10 +595,9 @@ pattern_search (file, archive, depth, recursions)
file->cmds = rule->cmds;
- /* Put the targets other than the one that
- matched into FILE's `also_make' member. */
+ /* If this rule builds other targets, too, put the others into FILE's
+ `also_make' member. */
- /* If there was only one target, there is nothing to do. */
if (rule->targets[1] != 0)
for (i = 0; rule->targets[i] != 0; ++i)
if (i != matches[foundrule])