mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2025-01-13 00:40:46 +00:00
Formerly variable.c.~17~
This commit is contained in:
parent
c653200459
commit
cf197b7550
1 changed files with 12 additions and 5 deletions
17
variable.c
17
variable.c
|
@ -490,11 +490,18 @@ target_environment (file)
|
||||||
for (b = table[i]; b != 0; b = b->next)
|
for (b = table[i]; b != 0; b = b->next)
|
||||||
{
|
{
|
||||||
register struct variable *v = b->variable;
|
register struct variable *v = b->variable;
|
||||||
/* If V is recursively expanded, expand its value. */
|
/* If V is recursively expanded and didn't come from the environment,
|
||||||
char *value = v->recursive ? recursively_expand (v) : v->value;
|
expand its value. If it came from the environment, it should
|
||||||
result[nvariables++] = concat (v->name, "=", value);
|
go back into the environment unchanged. */
|
||||||
if (v->recursive)
|
if (v->recursive
|
||||||
free (value);
|
&& v->origin != o_env && v->origin != o_env_override)
|
||||||
|
{
|
||||||
|
char *value = recursively_expand (v);
|
||||||
|
result[nvariables++] = concat (v->name, "=", value);
|
||||||
|
free (value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result[nvariables++] = concat (v->name, "=", v->value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result[nvariables] = (char *) xmalloc (100);
|
result[nvariables] = (char *) xmalloc (100);
|
||||||
|
|
Loading…
Reference in a new issue