Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): improve comments for .for loops



details:   https://anonhg.NetBSD.org/src/rev/870bd9757cf7
branches:  trunk
changeset: 979196:870bd9757cf7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Dec 19 13:31:37 2020 +0000

description:
make(1): improve comments for .for loops

diffstat:

 usr.bin/make/for.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 92924cb3082a -r 870bd9757cf7 usr.bin/make/for.c
--- a/usr.bin/make/for.c        Sat Dec 19 13:30:00 2020 +0000
+++ b/usr.bin/make/for.c        Sat Dec 19 13:31:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.119 2020/12/19 13:20:17 rillig Exp $ */
+/*     $NetBSD: for.c,v 1.120 2020/12/19 13:31:37 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -60,7 +60,7 @@
 #include "make.h"
 
 /*     "@(#)for.c      8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: for.c,v 1.119 2020/12/19 13:20:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.120 2020/12/19 13:31:37 rillig Exp $");
 
 static int forLevel = 0;       /* Nesting level */
 
@@ -416,9 +416,10 @@
  * Scan the for loop body and replace references to the loop variables
  * with variable references that expand to the required text.
  *
- * Using variable expansions ensures that the .for loop can't generate
+ * Using variable expressions ensures that the .for loop can't generate
  * syntax, and that the later parsing will still see a variable.
- * We assume that the null variable will never be defined.
+ * This code assumes that the variable with the empty name will never be
+ * defined, see unit-tests/varname-empty.mk for more details.
  *
  * The detection of substitutions of the loop control variable is naive.
  * Many of the modifiers use \ to escape $ (not $) so it is possible
@@ -468,7 +469,7 @@
        return cmds_str;
 }
 
-/* Run the for loop, imitating the actions of an include file. */
+/* Run the .for loop, imitating the actions of an include file. */
 void
 For_Run(int lineno)
 {



Home | Main Index | Thread Index | Old Index