mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-12-16 00:01:37 -05:00
Formerly variable.c.~13~
This commit is contained in:
parent
b8b8ba69d4
commit
a3254ad7b3
23
variable.c
23
variable.c
@ -500,9 +500,7 @@ target_environment (file)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to interpret LINE (a null-terminated string)
|
/* Try to interpret LINE (a null-terminated string) as a variable definition.
|
||||||
as a variable definition. If it is one, define the
|
|
||||||
variable and return 1. Otherwise return 0.
|
|
||||||
|
|
||||||
ORIGIN may be o_file, o_override, o_env, o_env_override,
|
ORIGIN may be o_file, o_override, o_env, o_env_override,
|
||||||
or o_command specifying that the variable definition comes
|
or o_command specifying that the variable definition comes
|
||||||
@ -528,9 +526,9 @@ try_variable_definition (line, origin)
|
|||||||
register char *beg;
|
register char *beg;
|
||||||
register char *end;
|
register char *end;
|
||||||
register int recursive;
|
register int recursive;
|
||||||
|
char *name, *expanded_name;
|
||||||
|
struct variable *v;
|
||||||
|
|
||||||
if (*p == '\t')
|
|
||||||
return 0;
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
c = *p++;
|
c = *p++;
|
||||||
@ -560,9 +558,18 @@ try_variable_definition (line, origin)
|
|||||||
--end;
|
--end;
|
||||||
p = next_token (p);
|
p = next_token (p);
|
||||||
|
|
||||||
return define_variable (beg, end - beg,
|
/* Expand the name, so "$(foo)bar = baz" works. */
|
||||||
recursive ? p : variable_expand (p),
|
name = savestring (beg, end - beg);
|
||||||
origin, recursive);
|
expanded_name = allocated_variable_expand (name);
|
||||||
|
free (name);
|
||||||
|
|
||||||
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
|
recursive ? p : variable_expand (p),
|
||||||
|
origin, recursive);
|
||||||
|
|
||||||
|
free (expanded_name);
|
||||||
|
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print information for variable V, prefixing it with PREFIX. */
|
/* Print information for variable V, prefixing it with PREFIX. */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user