=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/suff.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/usr.bin/make/suff.c 1998/12/05 00:06:29 1.11 +++ src/usr.bin/make/suff.c 1999/03/06 20:19:20 1.12 @@ -1,4 +1,4 @@ -/* $OpenBSD: suff.c,v 1.11 1998/12/05 00:06:29 espie Exp $ */ +/* $OpenBSD: suff.c,v 1.12 1999/03/06 20:19:20 millert Exp $ */ /* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -static char rcsid[] = "$OpenBSD: suff.c,v 1.11 1998/12/05 00:06:29 espie Exp $"; +static char rcsid[] = "$OpenBSD: suff.c,v 1.12 1999/03/06 20:19:20 millert Exp $"; #endif #endif /* not lint */ @@ -686,6 +686,7 @@ Lst_IsEmpty(gn->children)) { Suff *s, *t; + Lst p; (void)SuffParseTransform(gn->name, &s, &t); @@ -695,6 +696,11 @@ } /* + * Store s->parents because s could be deleted in SuffRemove + */ + p = s->parents; + + /* * Remove the source from the target's children list. We check for a * nil return to handle a beanhead saying something like * .c.o .c.o: @@ -707,8 +713,7 @@ /* * Remove the target from the source's parents list */ - if (s != NULL) - SuffRemove(s->parents, t); + SuffRemove(p, t); } else if ((gn->type & OP_TRANSFORM) && DEBUG(SUFF)) { printf("transformation %s complete\n", gn->name); }