diff options
author | Roland McGrath <roland@redhat.com> | 1992-11-23 20:53:24 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1992-11-23 20:53:24 +0000 |
commit | a3254ad7b34cb19e29142fac2c3338239cfe63cc (patch) | |
tree | 2f75f360b2c2673d451b3e1d544431e075d204ee | |
parent | b8b8ba69d4cf084f870e1a1f5fde15b3f9b2be77 (diff) | |
download | gunmake-a3254ad7b34cb19e29142fac2c3338239cfe63cc.tar.gz |
Formerly variable.c.~13~
-rw-r--r-- | variable.c | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -500,9 +500,7 @@ target_environment (file) return result; } -/* Try to interpret LINE (a null-terminated string) - as a variable definition. If it is one, define the - variable and return 1. Otherwise return 0. +/* Try to interpret LINE (a null-terminated string) as a variable definition. ORIGIN may be o_file, o_override, o_env, o_env_override, or o_command specifying that the variable definition comes @@ -528,9 +526,9 @@ try_variable_definition (line, origin) register char *beg; register char *end; register int recursive; + char *name, *expanded_name; + struct variable *v; - if (*p == '\t') - return 0; while (1) { c = *p++; @@ -560,9 +558,18 @@ try_variable_definition (line, origin) --end; p = next_token (p); - return define_variable (beg, end - beg, - recursive ? p : variable_expand (p), - origin, recursive); + /* Expand the name, so "$(foo)bar = baz" works. */ + name = savestring (beg, end - beg); + 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. */ |