summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1992-12-09 21:02:53 +0000
committerRoland McGrath <roland@redhat.com>1992-12-09 21:02:53 +0000
commit289417e0891850203236383bd245b9a0ea8e0383 (patch)
tree2d7bba0ca7e03d4102448b1603f1c844351774ae
parent1faf31158c84ff87a499379c9bf42022c0375249 (diff)
downloadgunmake-289417e0891850203236383bd245b9a0ea8e0383.tar.gz
Formerly read.c.~45~
-rw-r--r--read.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/read.c b/read.c
index e276bc6..24ed031 100644
--- a/read.c
+++ b/read.c
@@ -698,6 +698,12 @@ do_define (name, namelen, origin, lineno, infile, filename)
register unsigned int idx = 0;
register char *p;
+ /* Expand the variable name. */
+ char *var = alloca (namelen + 1);
+ bcopy (name, var, namelen);
+ var[namelen] = '\0';
+ var = variable_expand (var);
+
initbuffer (&lb);
while (!feof (infile))
{
@@ -718,7 +724,7 @@ do_define (name, namelen, origin, lineno, infile, filename)
definition[0] = '\0';
else
definition[idx - 1] = '\0';
- (void) define_variable (name, namelen, definition, origin, 1);
+ (void) define_variable (var, strlen (var), definition, origin, 1);
free (definition);
freebuffer (&lb);
return lineno;