summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2006-03-17 14:24:20 +0000
committerBoris Kolpackov <boris@kolpackov.net>2006-03-17 14:24:20 +0000
commit22886f8a74b5925030889fed52af5a8add5617d7 (patch)
treec28340c4ca8f7956e259f671b3202b6bf0874a35 /read.c
parent50eb3cf5e5a8a68b68e966a6607f668f2c36191e (diff)
downloadgunmake-22886f8a74b5925030889fed52af5a8add5617d7.tar.gz
Fixed Savannah bug #16053.
Diffstat (limited to 'read.c')
-rw-r--r--read.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/read.c b/read.c
index 0c78c7f..f6e8986 100644
--- a/read.c
+++ b/read.c
@@ -248,13 +248,9 @@ read_all_makefiles (char **makefiles)
tail = tail->next;
for (p = default_makefiles; *p != 0; ++p)
{
- struct dep *d = (struct dep *) xmalloc (sizeof (struct dep));
- d->name = 0;
+ struct dep *d = alloc_dep ();
d->file = enter_file (*p);
d->file->dontcare = 1;
- d->ignore_mtime = 0;
- d->staticpattern = 0;
- d->need_2nd_expansion = 0;
/* Tell update_goal_chain to bail out as soon as this file is
made, and main not to die if we can't make this file. */
d->changed = RM_DONTCARE;
@@ -366,18 +362,14 @@ eval_makefile (char *filename, int flags)
}
/* Add FILENAME to the chain of read makefiles. */
- deps = (struct dep *) xmalloc (sizeof (struct dep));
+ deps = alloc_dep ();
deps->next = read_makefiles;
read_makefiles = deps;
- deps->name = 0;
deps->file = lookup_file (filename);
if (deps->file == 0)
deps->file = enter_file (xstrdup (filename));
filename = deps->file->name;
deps->changed = flags;
- deps->ignore_mtime = 0;
- deps->staticpattern = 0;
- deps->need_2nd_expansion = 0;
if (flags & RM_DONTCARE)
deps->file->dontcare = 1;
@@ -1177,14 +1169,8 @@ eval (struct ebuffer *ebuf, int set_default)
if (beg <= end && *beg != '\0')
{
/* Put all the prerequisites here; they'll be parsed later. */
- deps = (struct dep *) xmalloc (sizeof (struct dep));
- deps->next = 0;
+ deps = alloc_dep ();
deps->name = savestring (beg, end - beg + 1);
- deps->file = 0;
- deps->changed = 0;
- deps->ignore_mtime = 0;
- deps->staticpattern = 0;
- deps->need_2nd_expansion = 0;
}
else
deps = 0;
@@ -2111,7 +2097,10 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent,
pattern_percent+1, percent+1);
f->stem = savestring (buffer, o - buffer);
if (this)
- this->staticpattern = 1;
+ {
+ this->staticpattern = 1;
+ this->stem = xstrdup (f->stem);
+ }
}
/* Free name if not needed further. */