summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-04-26 09:44:48 +0000
committerphk <phk@FreeBSD.org>1998-04-26 09:44:48 +0000
commit13f19b6005b3cdd99374c2602cf856a5dd151eb9 (patch)
treeb7cc8a8f9e386ccdcd0d3949fb319c2b740fcd3c /usr.bin/make
parent9b5cf9e92185f97913f5406421f9674d9573750e (diff)
downloadFreeBSD-src-13f19b6005b3cdd99374c2602cf856a5dd151eb9.zip
FreeBSD-src-13f19b6005b3cdd99374c2602cf856a5dd151eb9.tar.gz
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 <dima@tejblum.dnttm.rssi.ru>
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/suff.c28
1 files 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--;
+ }
}
/*-
OpenPOWER on IntegriCloud