From 68f837a46a330e10565b10f049139386283a1ac5 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sun, 26 Dec 2010 13:09:23 +0000 Subject: nits with current being NULL or not. okay miod@ --- usr.bin/make/lowparse.c | 6 +++--- usr.bin/make/parse.c | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/usr.bin/make/lowparse.c b/usr.bin/make/lowparse.c index 6b5b2d95ea8..533faa32274 100644 --- a/usr.bin/make/lowparse.c +++ b/usr.bin/make/lowparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lowparse.c,v 1.24 2010/07/19 19:46:44 espie Exp $ */ +/* $OpenBSD: lowparse.c,v 1.25 2010/12/26 13:09:22 espie Exp $ */ /* low-level parsing functions. */ @@ -163,8 +163,8 @@ Parse_FromString(char *str, unsigned long lineno) if (DEBUG(FOR)) (void)fprintf(stderr, "%s\n----\n", str); - if (current != NULL) - Lst_Push(&input_stack, current); + Lst_Push(&input_stack, current); + assert(current != NULL); current = new_input_string(str, current->fname, lineno); } diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 49563165d4e..efc1dab235b 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.99 2010/07/19 19:46:44 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.100 2010/12/26 13:09:22 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -1102,12 +1102,14 @@ resolve_include_filename(const char *file, bool isSystem) if (!isSystem && file[0] != '/') { /* ... by looking first under the same directory as the * current file */ - char *slash; + char *slash = NULL; const char *fname; fname = Parse_Getfilename(); - slash = strrchr(fname, '/'); + if (fname != NULL) + slash = strrchr(fname, '/'); + if (slash != NULL) { char *newName; -- cgit v1.2.3