Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Suff_ClearSuffixes() needs to re-initialize suf...
details: https://anonhg.NetBSD.org/src/rev/55c41f81b801
branches: trunk
changeset: 342408:55c41f81b801
user: sjg <sjg%NetBSD.org@localhost>
date: Sun Dec 20 22:44:10 2015 +0000
description:
Suff_ClearSuffixes() needs to re-initialize suffNull,
otherwise its children retain old suffixes.
Have Suff_Init() call Suff_ClearSuffixes() for consistency.
diffstat:
usr.bin/make/suff.c | 37 ++++++++++++++++++-------------------
1 files changed, 18 insertions(+), 19 deletions(-)
diffs (82 lines):
diff -r 6e00f799cf2d -r 55c41f81b801 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c Sun Dec 20 22:42:04 2015 +0000
+++ b/usr.bin/make/suff.c Sun Dec 20 22:44:10 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $ */
+/* $NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-__RCSID("$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $");
+__RCSID("$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -553,7 +553,20 @@
#endif
sufflist = Lst_Init(FALSE);
sNum = 0;
- suffNull = emptySuff;
+ if (suffNull)
+ SuffFree(suffNull);
+ emptySuff = suffNull = bmake_malloc(sizeof(Suff));
+
+ suffNull->name = bmake_strdup("");
+ suffNull->nameLen = 0;
+ suffNull->searchPath = Lst_Init(FALSE);
+ Dir_Concat(suffNull->searchPath, dirSearchPath);
+ suffNull->children = Lst_Init(FALSE);
+ suffNull->parents = Lst_Init(FALSE);
+ suffNull->ref = Lst_Init(FALSE);
+ suffNull->sNum = sNum++;
+ suffNull->flags = SUFF_NULL;
+ suffNull->refCount = 1;
}
/*-
@@ -2524,32 +2537,18 @@
void
Suff_Init(void)
{
- sufflist = Lst_Init(FALSE);
#ifdef CLEANUP
suffClean = Lst_Init(FALSE);
#endif
srclist = Lst_Init(FALSE);
transforms = Lst_Init(FALSE);
- sNum = 0;
/*
* Create null suffix for single-suffix rules (POSIX). The thing doesn't
* actually go on the suffix list or everyone will think that's its
* suffix.
*/
- emptySuff = suffNull = bmake_malloc(sizeof(Suff));
-
- suffNull->name = bmake_strdup("");
- suffNull->nameLen = 0;
- suffNull->searchPath = Lst_Init(FALSE);
- Dir_Concat(suffNull->searchPath, dirSearchPath);
- suffNull->children = Lst_Init(FALSE);
- suffNull->parents = Lst_Init(FALSE);
- suffNull->ref = Lst_Init(FALSE);
- suffNull->sNum = sNum++;
- suffNull->flags = SUFF_NULL;
- suffNull->refCount = 1;
-
+ Suff_ClearSuffixes();
}
Home |
Main Index |
Thread Index |
Old Index