summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2006-09-24 09:04:06 +0000
committerMarc Espie <espie@cvs.openbsd.org>2006-09-24 09:04:06 +0000
commitf78699f7e51a71709c6ef8a860e5de46ea992332 (patch)
tree4e3cb4229e2bca8fe162d1614c3fc7a1fa019aac /usr.bin
parent55452338c7ab287a8b8720077dd083cba91c70c6 (diff)
revert for now, this breaks stuff elsewhere...
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/suff.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 394588f00e6..f00b13483dc 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: suff.c,v 1.55 2006/09/17 19:03:15 espie Exp $ */
+/* $OpenBSD: suff.c,v 1.56 2006/09/24 09:04:05 espie Exp $ */
/* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */
/*
@@ -159,6 +159,8 @@ typedef struct {
} LstSrc;
static Suff *suffNull; /* The NULL suffix for this run */
+static Suff *emptySuff; /* The empty suffix required for POSIX
+ * single-suffix transformation rules */
static char *SuffStrIsPrefix(const char *, const char *);
@@ -189,7 +191,6 @@ static void SuffFindNormalDeps(GNode *, Lst);
static void SuffPrintName(void *);
static void SuffPrintSuff(void *);
static void SuffPrintTrans(void *);
-static Suff *emptySuff(void);
static LstNode suff_find_by_name(const char *);
static LstNode transform_find_by_name(const char *);
@@ -339,6 +340,9 @@ SuffFree(void *sp)
if (s == suffNull)
suffNull = NULL;
+ if (s == emptySuff)
+ emptySuff = NULL;
+
Lst_Destroy(&s->ref, NOFREE);
Lst_Destroy(&s->children, NOFREE);
Lst_Destroy(&s->parents, NOFREE);
@@ -414,7 +418,7 @@ Suff_ClearSuffixes(void)
#endif
Lst_Init(&sufflist);
sNum = 0;
- suffNull = emptySuff();
+ suffNull = emptySuff;
}
/*-
@@ -470,6 +474,7 @@ SuffParseTransform(
* find a double rule over a singleton, hence we leave this
* check until the end.
*
+ * XXX: Use emptySuff over suffNull?
*/
*srcPtr = single;
*targPtr = suffNull;
@@ -1958,28 +1963,20 @@ Suff_Init(void)
* actually go on the suffix list or everyone will think that's its
* suffix.
*/
-
- suffNull = emptySuff();
+ emptySuff = suffNull = emalloc(sizeof(Suff));
+
+ suffNull->name = estrdup("");
+ suffNull->nameLen = 0;
+ Lst_Init(&suffNull->searchPath);
+ Dir_Concat(&suffNull->searchPath, dirSearchPath);
+ Lst_Init(&suffNull->children);
+ Lst_Init(&suffNull->parents);
+ Lst_Init(&suffNull->ref);
+ suffNull->sNum = sNum++;
+ suffNull->flags = SUFF_NULL;
}
-Suff *
-emptySuff()
-{
- Suff *s;
- s = emalloc(sizeof(Suff));
-
- s->name = estrdup("");
- s->nameLen = 0;
- Lst_Init(&s->searchPath);
- Dir_Concat(&s->searchPath, dirSearchPath);
- Lst_Init(&s->children);
- Lst_Init(&s->parents);
- Lst_Init(&s->ref);
- s->sNum = sNum++;
- s->flags = SUFF_NULL;
- return s;
-}
/*-
*----------------------------------------------------------------------