=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/suff.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -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 **** ! /* $OpenBSD: suff.c,v 1.11 1998/12/05 00:06:29 espie Exp $ */ /* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */ /* --- 1,4 ---- ! /* $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,49 **** #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 $"; #endif #endif /* not lint */ --- 43,49 ---- #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else ! static char rcsid[] = "$OpenBSD: suff.c,v 1.12 1999/03/06 20:19:20 millert Exp $"; #endif #endif /* not lint */ *************** *** 686,691 **** --- 686,692 ---- Lst_IsEmpty(gn->children)) { Suff *s, *t; + Lst p; (void)SuffParseTransform(gn->name, &s, &t); *************** *** 695,700 **** --- 696,706 ---- } /* + * 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,714 **** /* * Remove the target from the source's parents list */ ! if (s != NULL) ! SuffRemove(s->parents, t); } else if ((gn->type & OP_TRANSFORM) && DEBUG(SUFF)) { printf("transformation %s complete\n", gn->name); } --- 713,719 ---- /* * Remove the target from the source's parents list */ ! SuffRemove(p, t); } else if ((gn->type & OP_TRANSFORM) && DEBUG(SUFF)) { printf("transformation %s complete\n", gn->name); }