Module Name: src
Committed By: rillig
Date: Mon Sep 7 06:58:02 UTC 2020
Modified Files:
src/usr.bin/make: parse.c
Log Message:
make(1): migrate Var_Parse to Var_ParsePP in ParseDoDependency
To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.287 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.286 src/usr.bin/make/parse.c:1.287
--- src/usr.bin/make/parse.c:1.286 Sun Sep 6 19:34:36 2020
+++ src/usr.bin/make/parse.c Mon Sep 7 06:58:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.286 2020/09/06 19:34:36 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.287 2020/09/07 06:58:02 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.286 2020/09/06 19:34:36 rillig Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.287 2020/09/07 06:58:02 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.286 2020/09/06 19:34:36 rillig Exp $");
+__RCSID("$NetBSD: parse.c,v 1.287 2020/09/07 06:58:02 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1190,8 +1190,7 @@ ParseDoDependency(char *line)
/* Find the end of the next word. */
for (cp = line; *cp && (ParseIsEscaped(lstart, cp) ||
!(isspace((unsigned char)*cp) ||
- *cp == '!' || *cp == ':' || *cp == LPAREN));
- cp++) {
+ *cp == '!' || *cp == ':' || *cp == LPAREN));) {
if (*cp == '$') {
/*
* Must be a dynamic source (would have been expanded
@@ -1200,14 +1199,15 @@ ParseDoDependency(char *line)
* no errors in this, as they would have been discovered
* in the initial Var_Subst and we wouldn't be here.
*/
- int length;
+ const char *nested_p = cp;
void *freeIt;
- (void)Var_Parse(cp, VAR_CMD, VARE_UNDEFERR|VARE_WANTRES,
- &length, &freeIt);
+ (void)Var_ParsePP(&nested_p, VAR_CMD,
+ VARE_UNDEFERR|VARE_WANTRES, &freeIt);
free(freeIt);
- cp += length - 1;
- }
+ cp += nested_p - cp;
+ } else
+ cp++;
}
/*