diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-12-26 13:09:23 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-12-26 13:09:23 +0000 |
commit | 68f837a46a330e10565b10f049139386283a1ac5 (patch) | |
tree | 0f75742a6fcacc2251aee7e066419d022543c97d /usr.bin/make/parse.c | |
parent | 4b2af33fc0fca45609385081d90f674ee2991039 (diff) |
nits with current being NULL or not.
okay miod@
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r-- | usr.bin/make/parse.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; |