summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-09-17 21:52:45 +0000
committerPaul Smith <psmith@gnu.org>2002-09-17 21:52:45 +0000
commitdac7b49de4b935db71d7b4257c6354f16fe41cfa (patch)
treef82cb34b108309d38903bd4d1695942e0b79e951 /read.c
parentd7ebcadadbfc100af64cc4c18580a6373bd52738 (diff)
downloadgunmake-dac7b49de4b935db71d7b4257c6354f16fe41cfa.tar.gz
Fix bug #940 (from the Savannah bug tracker): make sure that target-
specific variables work correctly in conjunction with double-colon targets.
Diffstat (limited to 'read.c')
-rw-r--r--read.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/read.c b/read.c
index dd930f7..3488524 100644
--- a/read.c
+++ b/read.c
@@ -1671,8 +1671,16 @@ record_target_var (filenames, defn, two_colon, origin, flocp)
{
struct file *f;
- /* Get a file reference for this file, and initialize it. */
- f = enter_file (name);
+ /* Get a file reference for this file, and initialize it.
+ We don't want to just call enter_file() because that allocates a
+ new entry if the file is a double-colon, which we don't want in
+ this situation. */
+ f = lookup_file (name);
+ if (!f)
+ f = enter_file (name);
+ else if (f->double_colon)
+ f = f->double_colon;
+
initialize_file_variables (f, 1);
vlist = f->variables;
fname = f->name;