Module Name:    src
Committed By:   rillig
Date:           Tue Dec 28 17:58:41 UTC 2021

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

Log Message:
make: remove redundant variable in ParseDependencyTargets

The idea of that variable was to work on constant strings as far as
possible.  For now it just blew up the code unnecessarily.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.598 -r1.599 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.598 src/usr.bin/make/parse.c:1.599
--- src/usr.bin/make/parse.c:1.598	Tue Dec 28 17:45:56 2021
+++ src/usr.bin/make/parse.c	Tue Dec 28 17:58:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.598 2021/12/28 17:45:56 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.599 2021/12/28 17:58:41 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.598 2021/12/28 17:45:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.599 2021/12/28 17:58:41 rillig Exp $");
 
 /* types and constants */
 
@@ -1010,7 +1010,7 @@ ParseErrorNoDependency(const char *lstar
 }
 
 static void
-ParseDependencyTargetWord(const char **pp, const char *lstart)
+ParseDependencyTargetWord(char **pp, const char *lstart)
 {
 	const char *cp = *pp;
 
@@ -1042,7 +1042,7 @@ ParseDependencyTargetWord(const char **p
 			cp++;
 	}
 
-	*pp = cp;
+	*pp += cp - *pp;
 }
 
 /*
@@ -1386,14 +1386,11 @@ ParseDependencyTargets(char **inout_cp,
 	char *cp;
 	char *tgt = *inout_cp;
 	char savec;
-	const char *p;
 
 	for (;;) {
 		/* Find the end of the next word. */
 		cp = tgt;
-		p = cp;
-		ParseDependencyTargetWord(&p, lstart);
-		cp += p - cp;
+		ParseDependencyTargetWord(&cp, lstart);
 
 		/*
 		 * If the word is followed by a left parenthesis, it's the

Reply via email to