aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/for.c
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2022-07-26 16:07:25 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2022-07-26 16:09:32 +0000
commit954401e68e797868ab04a0147b94849feefbb199 (patch)
tree05a700d8b8ba811baaa05cb3e831ad2625445c89 /contrib/bmake/for.c
parente7437ae907c89bf85a99c5cbb7ddd194a1ff1354 (diff)
parent308a28d6cd2e87028e535eabccb89a9dc2fd9515 (diff)
downloadsrc-954401e68e797868ab04a0147b94849feefbb199.tar.gz
src-954401e68e797868ab04a0147b94849feefbb199.zip
Diffstat (limited to 'contrib/bmake/for.c')
-rw-r--r--contrib/bmake/for.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/bmake/for.c b/contrib/bmake/for.c
index c36641fa8c4e..65cb612fdc5b 100644
--- a/contrib/bmake/for.c
+++ b/contrib/bmake/for.c
@@ -1,4 +1,4 @@
-/* $NetBSD: for.c,v 1.167 2022/02/04 23:22:19 rillig Exp $ */
+/* $NetBSD: for.c,v 1.168 2022/06/12 16:09:21 rillig Exp $ */
/*
* Copyright (c) 1992, The Regents of the University of California.
@@ -58,7 +58,7 @@
#include "make.h"
/* "@(#)for.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: for.c,v 1.167 2022/02/04 23:22:19 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.168 2022/06/12 16:09:21 rillig Exp $");
typedef struct ForLoop {
@@ -269,7 +269,14 @@ For_Accum(const char *line, int *forLevel)
return true;
}
-
+/*
+ * When the body of a '.for i' loop is prepared for an iteration, each
+ * occurrence of $i in the body is replaced with ${:U...}, inserting the
+ * value of the item. If this item contains a '$', it may be the start of a
+ * variable expression. This expression is copied verbatim, its length is
+ * determined here, in a rather naive way, ignoring escape characters and
+ * funny delimiters in modifiers like ':S}from}to}'.
+ */
static size_t
ExprLen(const char *s, const char *e)
{