summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-09-09 21:56:55 +0000
committerPaul Smith <psmith@gnu.org>2012-09-09 21:56:55 +0000
commit58f3ef27b7c6cae14a51c885de473a549f8492ca (patch)
treebadd1a144c15e01c117cf4f56a5047b1cc29fc5b /file.c
parent4f69f1544b6e511bfe23aa07cc1cfb5a63b874a7 (diff)
downloadmake-58f3ef27b7c6cae14a51c885de473a549f8492ca.tar.gz
Save the variable buffer content, not a potentially old pointer to it.
Fixes Savannah bug #36925.
Diffstat (limited to 'file.c')
-rw-r--r--file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/file.c b/file.c
index 21582e00..896f7e22 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;
}