diff options
| author | Thomas Moestl <tmm@FreeBSD.org> | 2001-03-08 00:55:08 +0000 |
|---|---|---|
| committer | Thomas Moestl <tmm@FreeBSD.org> | 2001-03-08 00:55:08 +0000 |
| commit | a333d4f752453ccdb71c1bb03b9a0fd25df15e24 (patch) | |
| tree | c357016f22ee2e864c16fb8a477b1586bb0a9e9e /usr.bin/make | |
| parent | 73e89fa2d4dba2c457b784b38168a89fe4498252 (diff) | |
Notes
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/suff.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index 81d4216190a73..8ade95edb4812 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -460,8 +460,16 @@ Suff_ClearSuffixes () { Lst_Concat (suffClean, sufflist, LST_CONCLINK); sufflist = Lst_Init(FALSE); - sNum = 0; + sNum = 1; suffNull = emptySuff; + /* + * Clear suffNull's children list (the other suffixes are built new, but + * suffNull is used as is). + * NOFREE is used because all suffixes are are on the suffClean list. + * suffNull should not have parents. + */ + Lst_Destroy(suffNull->children, NOFREE); + suffNull->children = Lst_Init(FALSE); } /*- @@ -714,20 +722,25 @@ SuffRebuildGraph(transformp, sp) Suff *s = (Suff *) sp; char *cp; LstNode ln; - Suff *s2; + Suff *s2 = NULL; /* * First see if it is a transformation from this suffix. */ cp = SuffStrIsPrefix(s->name, transform->name); if (cp != (char *)NULL) { - ln = Lst_Find(sufflist, (void *)cp, SuffSuffHasNameP); - if (ln != NULL) { + if (cp[0] == '\0') /* null rule */ + s2 = suffNull; + else { + ln = Lst_Find(sufflist, (void *)cp, SuffSuffHasNameP); + if (ln != NULL) + s2 = (Suff *)Lst_Datum(ln); + } + if (s2 != NULL) { /* * Found target. Link in and return, since it can't be anything * else. */ - s2 = (Suff *)Lst_Datum(ln); SuffInsert(s2->children, s); SuffInsert(s->parents, s2); return(0); @@ -2359,7 +2372,7 @@ static int SuffPrintName(s, dummy) void * s; void * dummy; { - printf ("%s ", ((Suff *) s)->name); + printf ("`%s' ", ((Suff *) s)->name); return (dummy ? 0 : 0); } |
