From a839588fc940a359603dcca47adde5c97fb39aa9 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 9 Sep 2012 21:56:55 +0000 Subject: Save the variable buffer content, not a potentially old pointer to it. Fixes Savannah bug #36925. --- file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 21582e0..896f7e2 100644 --- a/file.c +++ b/file.c @@ -573,12 +573,11 @@ expand_deps (struct file *f) "$*" so they'll expand properly. */ if (d->staticpattern) { - char *o; - d->name = o = variable_expand (""); + char *o = variable_expand (""); o = subst_expand (o, name, "%", "$*", 1, 2, 0); *o = '\0'; free (name); - d->name = name = xstrdup (d->name); + d->name = name = xstrdup (variable_buffer); d->staticpattern = 0; } -- cgit v1.2.3