summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2021-12-28 01:27:37 +0000
committerrillig <rillig@NetBSD.org>2021-12-28 01:27:37 +0000
commitc696b1e1bd3d3e5b634abf78ff27f2a98f07100a (patch)
tree87713568c7ead069f6e7e6bcc2c5f98be059bb72 /usr.bin/make/parse.c
parent9bc8008eef23f0c046e4fe2e0567f236a1474216 (diff)
make: remove redundant local variable
The variable name 'end' suggested pointing to the end of the string, but instead it pointed to the last possible starting position of the word to be searched. Remove this possible misunderstanding. No functional change.
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r--usr.bin/make/parse.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 15ff32a1d26..537c3df46f4 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.587 2021/12/27 21:21:17 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.588 2021/12/28 01:27:37 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.587 2021/12/27 21:21:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.588 2021/12/28 01:27:37 rillig Exp $");
/* types and constants */
@@ -2307,16 +2307,15 @@ StrContainsWord(const char *str, const char *word)
{
size_t strLen = strlen(str);
size_t wordLen = strlen(word);
- const char *p, *end;
+ const char *p;
if (strLen < wordLen)
return false;
- end = str + strLen - wordLen;
for (p = str; p != NULL; p = strchr(p, ' ')) {
if (*p == ' ')
p++;
- if (p > end)
+ if (p > str + strLen - wordLen)
return false;
if (memcmp(p, word, wordLen) == 0 &&