summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-12-26 13:09:23 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-12-26 13:09:23 +0000
commit68f837a46a330e10565b10f049139386283a1ac5 (patch)
tree0f75742a6fcacc2251aee7e066419d022543c97d /usr.bin
parent4b2af33fc0fca45609385081d90f674ee2991039 (diff)
nits with current being NULL or not.
okay miod@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/lowparse.c6
-rw-r--r--usr.bin/make/parse.c8
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;