summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--implicit.c16
-rw-r--r--makefile.vms2
-rw-r--r--variable.c17
4 files changed, 24 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 969df36..b2cde4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-20 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (merge_variable_set_lists): It's legal for *setlist0
+ to be null; don't core in that case.
+
2006-02-19 Paul D. Smith <psmith@gnu.org>
* commands.c (set_file_variables): Realloc, not malloc, the static
diff --git a/implicit.c b/implicit.c
index 054b71a..b8f1054 100644
--- a/implicit.c
+++ b/implicit.c
@@ -80,19 +80,21 @@ static void
free_idep_chain (struct idep *p)
{
struct idep *n;
- struct file *f;
for (; p != 0; p = n)
{
n = p->next;
if (p->name)
- free (p->name);
+ {
+ struct file *f = p->intermediate_file;
+
+ if (f != 0
+ && (f->stem < f->name || f->stem > f->name + strlen (f->name)))
+ free (f->stem);
- f = p->intermediate_file;
- if (f != 0
- && (f->stem < f->name || f->stem > f->name + strlen (f->name)))
- free (f->stem);
+ free (p->name);
+ }
free (p);
}
@@ -836,7 +838,7 @@ pattern_search (struct file *file, int archive,
f->deps = imf->deps;
f->cmds = imf->cmds;
- f->stem = xstrdup (imf->stem);
+ f->stem = imf->stem;
f->also_make = imf->also_make;
f->is_target = 1;
diff --git a/makefile.vms b/makefile.vms
index 2fd2b89..3b956a4 100644
--- a/makefile.vms
+++ b/makefile.vms
@@ -32,7 +32,7 @@ CP = copy
#
ifeq ($(CC),cc)
-CFLAGS = $(defines) /include=([],[.glob])/prefix=(all,except=(glob,globfree))/standard=relaxed
+CFLAGS = $(defines) /include=([],[.glob])/prefix=(all,except=(glob,globfree))/standard=relaxed/warn=(disable=questcompare)
else
CFLAGS = $(defines) /include=([],[.glob])
endif
diff --git a/variable.c b/variable.c
index 39f0ada..54bbc02 100644
--- a/variable.c
+++ b/variable.c
@@ -674,16 +674,17 @@ merge_variable_set_lists (struct variable_set_list **setlist0,
/* This loop relies on the fact that all setlists terminate with the global
setlist (before NULL). If that's not true, arguably we SHOULD die. */
- while (setlist1 != &global_setlist && to != &global_setlist)
- {
- struct variable_set_list *from = setlist1;
- setlist1 = setlist1->next;
+ if (to)
+ while (setlist1 != &global_setlist && to != &global_setlist)
+ {
+ struct variable_set_list *from = setlist1;
+ setlist1 = setlist1->next;
- merge_variable_sets (to->set, from->set);
+ merge_variable_sets (to->set, from->set);
- last0 = to;
- to = to->next;
- }
+ last0 = to;
+ to = to->next;
+ }
if (setlist1 != &global_setlist)
{