From 13f19b6005b3cdd99374c2602cf856a5dd151eb9 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 26 Apr 1998 09:44:48 +0000 Subject: When all transformation rules to or from a suffix disappeared, make tries to free the suffix. I think, it is a very strange idea. (Or, maybe, it is a POSIX requirement?) And it is done incorrectly. Apparently, it even don't update the list of known suffixes (but it is an other bug). PR: 4254, 4692, 4783 Reviewed by: phk Submitted by: Dmitrij Tejblum --- usr.bin/make/suff.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index 5d3cf9a..040f9c5 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: suff.c,v 1.8 1997/02/22 19:27:23 peter Exp $ */ #ifndef lint @@ -160,7 +160,6 @@ static int SuffSuffIsSuffixP __P((ClientData, ClientData)); static int SuffSuffHasNameP __P((ClientData, ClientData)); static int SuffSuffIsPrefix __P((ClientData, ClientData)); static int SuffGNHasNameP __P((ClientData, ClientData)); -static void SuffUnRef __P((ClientData, ClientData)); static void SuffFree __P((ClientData)); static void SuffInsert __P((Lst, Suff *)); static void SuffRemove __P((Lst, Suff *)); @@ -327,20 +326,6 @@ SuffGNHasNameP (gn, name) /*********** Maintenance Functions ************/ -static void -SuffUnRef(lp, sp) - ClientData lp; - ClientData sp; -{ - Lst l = (Lst) lp; - - LstNode ln = Lst_Member(l, sp); - if (ln != NILLNODE) { - Lst_Remove(l, ln); - ((Suff *) sp)->refCount--; - } -} - /*- *----------------------------------------------------------------------- * SuffFree -- @@ -383,8 +368,7 @@ SuffFree (sp) * None * * Side Effects: - * The reference count for the suffix is decremented and the - * suffix is possibly freed + * The reference count for the suffix is decremented *----------------------------------------------------------------------- */ static void @@ -392,9 +376,11 @@ SuffRemove(l, s) Lst l; Suff *s; { - SuffUnRef((ClientData) l, (ClientData) s); - if (s->refCount == 0) - SuffFree((ClientData) s); + LstNode ln = Lst_Member(l, (ClientData)s); + if (ln != NILLNODE) { + Lst_Remove(l, ln); + s->refCount--; + } } /*- -- cgit v1.1