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
This commit is contained in:
Andrey A. Chernov 1995-06-18 12:34:14 +00:00
parent ecf74fe675
commit 76da55f6bc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9254
5 changed files with 26 additions and 5 deletions

View File

@ -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));
/*-

View File

@ -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 @@ ParseReadLine ()
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;

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}