summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-06-18 12:34:14 +0000
committerache <ache@FreeBSD.org>1995-06-18 12:34:14 +0000
commit5b84039fb3ea9614bccce9c2e800251228ab7e7c (patch)
tree91257bccf4dda92d8334ba4a74af5a2241987117
parent1c7c56a93b2ee67dd860c2b2c4f4b9a918a538de (diff)
downloadFreeBSD-src-5b84039fb3ea9614bccce9c2e800251228ab7e7c.zip
FreeBSD-src-5b84039fb3ea9614bccce9c2e800251228ab7e7c.tar.gz
NetBSD fixes: declare more prototypes, move .OPTIONAL in alphabet
order, prevent suffix rule, if direct or children dependances exists, forget to free v->name in var.c My fixes: fix famous ^\t\n bug, correct free order in str_end Reviewed by: bde Obtained from: NetBSD, me
-rw-r--r--usr.bin/make/make.c2
-rw-r--r--usr.bin/make/parse.c4
-rw-r--r--usr.bin/make/str.c9
-rw-r--r--usr.bin/make/suff.c15
-rw-r--r--usr.bin/make/var.c1
5 files changed, 26 insertions, 5 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index f4c83d6..d6959a8 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -88,6 +88,8 @@ static int numNodes; /* Number of nodes to be processed. If this
static int MakeAddChild __P((ClientData, ClientData));
static int MakeAddAllSrc __P((ClientData, ClientData));
+static int MakeTimeStamp __P((ClientData, ClientData));
+static int MakeHandleUse __P((ClientData, ClientData));
static Boolean MakeStartJobs __P((void));
static int MakePrintStatus __P((ClientData, ClientData));
/*-
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 27b3ff7..2263a52 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -193,7 +193,6 @@ static struct {
} parseKeywords[] = {
{ ".BEGIN", Begin, 0 },
{ ".DEFAULT", Default, 0 },
-{ ".OPTIONAL", Attribute, OP_OPTIONAL },
{ ".END", End, 0 },
{ ".EXEC", Attribute, OP_EXEC },
{ ".IGNORE", Ignore, OP_IGNORE },
@@ -209,6 +208,7 @@ static struct {
{ ".NOTMAIN", Attribute, OP_NOTMAIN },
{ ".NOTPARALLEL", NotParallel, 0 },
{ ".NULL", Null, 0 },
+{ ".OPTIONAL", Attribute, OP_OPTIONAL },
{ ".ORDER", Order, 0 },
{ ".PATH", ExPath, 0 },
{ ".PRECIOUS", Precious, OP_PRECIOUS },
@@ -2259,6 +2259,8 @@ test_char:
while (ep > line && (ep[-1] == ' ' || ep[-1] == '\t')) {
if (ep > line + 1 && ep[-2] == '\\')
break;
+ if (ep == line + 1 && ep[-1] == '\t')
+ break;
--ep;
}
*ep = 0;
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c
index 35e50fe..2dea338 100644
--- a/usr.bin/make/str.c
+++ b/usr.bin/make/str.c
@@ -38,7 +38,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; */
-static char *rcsid = "$Id: str.c,v 1.3 1995/01/23 21:02:00 jkh Exp $";
+static char *rcsid = "$Id: str.c,v 1.4 1995/05/30 06:32:05 rgrimes Exp $";
#endif /* not lint */
#include "make.h"
@@ -68,8 +68,11 @@ str_init()
void
str_end()
{
- free(argv[0]);
- free((Address) argv);
+ if (argv) {
+ if (argv[0])
+ free(argv[0]);
+ free((Address) argv);
+ }
if (buffer)
free(buffer);
}
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 1980bae..7340383 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1911,7 +1911,20 @@ SuffFindNormalDeps(gn, slst)
targ->cp = Lst_Init(FALSE);
#endif
- SuffAddLevel(srcs, targ);
+ /*
+ * Only use the default suffix rules if we don't have commands
+ * or dependencies defined for this gnode
+ */
+ if (Lst_IsEmpty(gn->commands) && Lst_IsEmpty(gn->children))
+ SuffAddLevel(srcs, targ);
+ else {
+ if (DEBUG(SUFF))
+ printf("not ");
+ }
+
+ if (DEBUG(SUFF))
+ printf("adding suffix rules\n");
+
(void)Lst_AtEnd(targs, (ClientData)targ);
}
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 1019ab5..851a80c 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -536,6 +536,7 @@ Var_Exists(name, ctxt)
if (v == (Var *)NIL) {
return(FALSE);
} else if (v->flags & VAR_FROM_ENV) {
+ free(v->name);
Buf_Destroy(v->val, TRUE);
free((char *)v);
}
OpenPOWER on IntegriCloud