Module Name:    src
Committed By:   rillig
Date:           Tue Dec 28 01:27:37 UTC 2021

Modified Files:
        src/usr.bin/make: parse.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.587 -r1.588 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/parse.c
diff -u src/usr.bin/make/parse.c:1.587 src/usr.bin/make/parse.c:1.588
--- src/usr.bin/make/parse.c:1.587	Mon Dec 27 21:21:17 2021
+++ src/usr.bin/make/parse.c	Tue Dec 28 01:27:37 2021
@@ -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 c
 {
 	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 &&

Reply via email to