Fixes Savannah bug #36925.
2012-09-09 Paul Smith <psmith@gnu.org>
+ * file.c (expand_deps): Duplicate the current variable buffer, not
+ the old pointer. Fixes Savannah bug #36925.
+
* read.c (eval): If we detect an initial UTF-8 BOM, skip it.
Fixes Savannah bug #36529.
(record_target_var): Remove unused variable "fname".
"$*" 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;
}