summaryrefslogtreecommitdiff
path: root/implicit.c
diff options
context:
space:
mode:
Diffstat (limited to 'implicit.c')
-rw-r--r--implicit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/implicit.c b/implicit.c
index 4211e3b..02b1a91 100644
--- a/implicit.c
+++ b/implicit.c
@@ -917,7 +917,8 @@ pattern_search (struct file *file, int archive,
for (ri = 0; ri < rule->num; ++ri)
if (ri != matches[foundrule])
{
- char *p = alloca (rule->lens[ri] + fullstemlen + 1);
+ char *nm = alloca (rule->lens[ri] + fullstemlen + 1);
+ char *p = nm;
struct file *f;
struct dep *new = alloc_dep ();
@@ -929,7 +930,7 @@ pattern_search (struct file *file, int archive,
p += fullstemlen;
memcpy (p, rule->suffixes[ri],
rule->lens[ri] - (rule->suffixes[ri] - rule->targets[ri])+1);
- new->name = strcache_add (p);
+ new->name = strcache_add (nm);
new->file = enter_file (new->name);
new->next = file->also_make;