From 605f6cf148394b2dba262e0b91f37ff35ecafe76 Mon Sep 17 00:00:00 2001 From: pk Date: Tue, 12 Mar 2002 23:52:35 +0000 Subject: [PATCH] MakeAddAllSrc(): check for empty .ALLSRC variable before using its value. --- usr.bin/make/make.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 8ec5e8dee92d..396b340465f0 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.45 2002/03/08 23:22:38 pk Exp $ */ +/* $NetBSD: make.c,v 1.46 2002/03/12 23:52:35 pk Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: make.c,v 1.45 2002/03/08 23:22:38 pk Exp $"; +static char rcsid[] = "$NetBSD: make.c,v 1.46 2002/03/12 23:52:35 pk Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: make.c,v 1.45 2002/03/08 23:22:38 pk Exp $"); +__RCSID("$NetBSD: make.c,v 1.46 2002/03/12 23:52:35 pk Exp $"); #endif #endif /* not lint */ #endif @@ -756,7 +756,8 @@ MakeAddAllSrc (cgnp, pgnp) } else { allsrc = child; } - Var_Append (ALLSRC, allsrc, pgn); + if (allsrc != NULL) + Var_Append (ALLSRC, allsrc, pgn); if (p2) free(p2); if (pgn->type & OP_JOIN) {