Module Name: src
Committed By: rillig
Date: Wed Dec 23 14:13:49 UTC 2020
Modified Files:
src/usr.bin/make: main.c parse.c
Log Message:
make(1): fix a few lint warnings
To generate a diff of this commit:
cvs rdiff -u -r1.501 -r1.502 src/usr.bin/make/main.c
cvs rdiff -u -r1.515 -r1.516 src/usr.bin/make/parse.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.501 src/usr.bin/make/main.c:1.502
--- src/usr.bin/make/main.c:1.501 Wed Dec 23 13:50:54 2020
+++ src/usr.bin/make/main.c Wed Dec 23 14:13:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.501 2020/12/23 13:50:54 rillig Exp $ */
+/* $NetBSD: main.c,v 1.502 2020/12/23 14:13:49 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.501 2020/12/23 13:50:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.502 2020/12/23 14:13:49 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -1147,10 +1147,11 @@ InitVarMake(const char *argv0)
if (argv0[0] != '/' && strchr(argv0, '/') != NULL) {
char pathbuf[MAXPATHLEN];
- const char *abs = cached_realpath(argv0, pathbuf);
+ const char *abspath = cached_realpath(argv0, pathbuf);
struct stat st;
- if (abs != NULL && abs[0] == '/' && stat(make, &st) == 0)
- make = abs;
+ if (abspath != NULL && abspath[0] == '/' &&
+ stat(make, &st) == 0)
+ make = abspath;
}
Var_Set("MAKE", make, VAR_GLOBAL);
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.515 src/usr.bin/make/parse.c:1.516
--- src/usr.bin/make/parse.c:1.515 Wed Dec 23 13:50:54 2020
+++ src/usr.bin/make/parse.c Wed Dec 23 14:13:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.515 2020/12/23 13:50:54 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.516 2020/12/23 14:13:49 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.515 2020/12/23 13:50:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.516 2020/12/23 14:13:49 rillig Exp $");
/* types and constants */
@@ -2204,7 +2204,7 @@ Parse_include_file(char *file, Boolean i
const char *suff;
SearchPath *suffPath = NULL;
- if ((suff = strrchr(file, '.'))) {
+ if ((suff = strrchr(file, '.')) != NULL) {
suffPath = Suff_GetPath(suff);
if (suffPath != NULL)
fullname = Dir_FindFile(file, suffPath);