summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-07-02 20:47:29 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-07-02 20:47:29 +0000
commit1ddbadcdf0b3d98f4bbf1fcc64f13fed93faabc9 (patch)
tree3713040e71827524350983a34ac2ed1ba8a2266f /usr.bin/make/parse.c
parent26ced62b330504f2eefd1ad38228354a57fc5733 (diff)
Fix a bug where make gets confused by targets beginning with a period (``.'')
and tried to do a suffix conversion, following a NULL pointer in the proccess. Also add some sanity checks so we don't blindly assume strchr returns non-NULL.
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r--usr.bin/make/parse.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index f2b8d73a4a4..2372691bfbb 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.15 1997/07/25 21:05:35 mickey Exp $ */
+/* $OpenBSD: parse.c,v 1.16 1998/07/02 20:47:26 millert Exp $ */
/* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: parse.c,v 1.15 1997/07/25 21:05:35 mickey Exp $";
+static char rcsid[] = "$OpenBSD: parse.c,v 1.16 1998/07/02 20:47:26 millert Exp $";
#endif
#endif /* not lint */
@@ -943,7 +943,8 @@ ParseDoDependency (line)
gn = Suff_AddTransform (targName);
}
- (void)Lst_AtEnd (targets, (ClientData)gn);
+ if (gn != NULL)
+ (void)Lst_AtEnd (targets, (ClientData)gn);
}
} else if (specType == ExPath && *line != '.' && *line != '\0') {
Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line);