summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-09-18 20:51:58 +0000
committerPaul Smith <psmith@gnu.org>2002-09-18 20:51:58 +0000
commitebd05dbeb31dbc09c496d76e802d9b68bd848e9a (patch)
treeda4a5274f20e107b74120f1f1bef2e43b2f38113 /read.c
parent76652d5d02b31941ec085435f62b6c955d7e63d3 (diff)
downloadgunmake-ebd05dbeb31dbc09c496d76e802d9b68bd848e9a.tar.gz
Fix a bug exporting/unexporting multiple variables in one command.
Update the text about reporting bugs.
Diffstat (limited to 'read.c')
-rw-r--r--read.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/read.c b/read.c
index 3488524..c135acc 100644
--- a/read.c
+++ b/read.c
@@ -683,25 +683,23 @@ eval (ebuf, set_default)
else
{
unsigned int len;
+ char *ap;
+
+ /* Expand the line so we can use indirect and constructed
+ variable names in an export command. */
+ p2 = ap = allocated_variable_expand (p2);
+
for (p = find_next_token (&p2, &len); p != 0;
p = find_next_token (&p2, &len))
{
- char *var;
- int l;
-
- /* Expand the thing we're looking up, so we can use
- indirect and constructed variable names. */
- p[len] = '\0';
- var = allocated_variable_expand (p);
- l = strlen (var);
-
- v = lookup_variable (var, l);
+ v = lookup_variable (p, len);
if (v == 0)
- v = define_variable_loc (var, l, "", o_file, 0,
+ v = define_variable_loc (p, len, "", o_file, 0,
fstart);
v->export = v_export;
- free (var);
}
+
+ free (ap);
}
}
goto rule_complete;
@@ -715,26 +713,23 @@ eval (ebuf, set_default)
{
unsigned int len;
struct variable *v;
+ char *ap;
+
+ /* Expand the line so we can use indirect and constructed
+ variable names in an unexport command. */
+ p2 = ap = allocated_variable_expand (p2);
+
for (p = find_next_token (&p2, &len); p != 0;
p = find_next_token (&p2, &len))
{
- char *var;
- int l;
-
- /* Expand the thing we're looking up, so we can use
- indirect and constructed variable names. */
- p[len] = '\0';
- var = allocated_variable_expand (p);
- l = strlen (var);
-
- v = lookup_variable (var, l);
+ v = lookup_variable (p, len);
if (v == 0)
- v = define_variable_loc (var, l, "", o_file, 0, fstart);
+ v = define_variable_loc (p, len, "", o_file, 0, fstart);
v->export = v_noexport;
-
- free (var);
}
+
+ free (ap);
}
goto rule_complete;
}