Module Name: src Committed By: rillig Date: Sat Mar 26 13:32:32 UTC 2022
Modified Files: src/usr.bin/make: var.c src/usr.bin/make/unit-tests: opt-env.exp opt-env.mk opt-file.mk Log Message: make: clean up comments To generate a diff of this commit: cvs rdiff -u -r1.1014 -r1.1015 src/usr.bin/make/var.c cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-env.exp cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-env.mk cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/opt-file.mk 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/var.c diff -u src/usr.bin/make/var.c:1.1014 src/usr.bin/make/var.c:1.1015 --- src/usr.bin/make/var.c:1.1014 Sat Mar 26 12:44:57 2022 +++ src/usr.bin/make/var.c Sat Mar 26 13:32:31 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.1014 2022/03/26 12:44:57 rillig Exp $ */ +/* $NetBSD: var.c,v 1.1015 2022/03/26 13:32:31 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -139,7 +139,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.1014 2022/03/26 12:44:57 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.1015 2022/03/26 13:32:31 rillig Exp $"); /* * Variables are defined using one of the VAR=value assignments. Their @@ -4016,9 +4016,9 @@ cleanup: /* * TODO: Use p + strlen(p) instead, to stop parsing immediately. * - * In the unit tests, this generates a few unterminated strings in the - * shell commands though. Instead of producing these unfinished - * strings, commands with evaluation errors should not be run at all. + * In the unit tests, this generates a few shell commands with + * unbalanced quotes. Instead of producing these incomplete strings, + * commands with evaluation errors should not be run at all. * * To make that happen, Var_Subst must report the actual errors * instead of returning VPR_OK unconditionally. @@ -4028,8 +4028,8 @@ cleanup: } /* - * Only 4 of the 7 local variables are treated specially as they are the only - * ones that will be set when dynamic sources are expanded. + * Only 4 of the 7 built-in local variables are treated specially as they are + * the only ones that will be set when dynamic sources are expanded. */ static bool VarnameIsDynamic(Substring varname) Index: src/usr.bin/make/unit-tests/opt-env.exp diff -u src/usr.bin/make/unit-tests/opt-env.exp:1.2 src/usr.bin/make/unit-tests/opt-env.exp:1.3 --- src/usr.bin/make/unit-tests/opt-env.exp:1.2 Sun Jan 23 16:09:38 2022 +++ src/usr.bin/make/unit-tests/opt-env.exp Sat Mar 26 13:32:31 2022 @@ -1,5 +1,5 @@ -make: "opt-env.mk" line 9: Malformed conditional (${FROM_ENV} != value-from-env) -make: "opt-env.mk" line 16: value-from-mk +make: "opt-env.mk" line 13: Malformed conditional (${FROM_ENV} != value-from-env) +make: "opt-env.mk" line 20: value-from-mk make: stopped in unit-tests exit status 1 Index: src/usr.bin/make/unit-tests/opt-env.mk diff -u src/usr.bin/make/unit-tests/opt-env.mk:1.3 src/usr.bin/make/unit-tests/opt-env.mk:1.4 --- src/usr.bin/make/unit-tests/opt-env.mk:1.3 Sun Jan 23 16:09:38 2022 +++ src/usr.bin/make/unit-tests/opt-env.mk Sat Mar 26 13:32:31 2022 @@ -1,6 +1,10 @@ -# $NetBSD: opt-env.mk,v 1.3 2022/01/23 16:09:38 rillig Exp $ +# $NetBSD: opt-env.mk,v 1.4 2022/03/26 13:32:31 rillig Exp $ # -# Tests for the -e command line option. +# Tests for the -e command line option, which looks up environment variables +# before those from the global scope. It has no influence on variables from +# the command line though. +# +# This option is required by POSIX. # The variable FROM_ENV is defined in ./Makefile. Index: src/usr.bin/make/unit-tests/opt-file.mk diff -u src/usr.bin/make/unit-tests/opt-file.mk:1.14 src/usr.bin/make/unit-tests/opt-file.mk:1.15 --- src/usr.bin/make/unit-tests/opt-file.mk:1.14 Thu Dec 9 20:47:33 2021 +++ src/usr.bin/make/unit-tests/opt-file.mk Sat Mar 26 13:32:31 2022 @@ -1,4 +1,4 @@ -# $NetBSD: opt-file.mk,v 1.14 2021/12/09 20:47:33 rillig Exp $ +# $NetBSD: opt-file.mk,v 1.15 2022/03/26 13:32:31 rillig Exp $ # # Tests for the -f command line option, which adds a makefile to the list of # files that are parsed. @@ -15,7 +15,7 @@ all: file-containing-null-byte # possible. # # In the unlikely case where a file ends in a backslash instead of a newline, -# that backslash is trimmed. See ParseGetLine. +# that backslash is trimmed. See ReadLowLevelLine. # # make-2014.01.01.00.00.00 invoked undefined behavior, reading text from # outside of the file buffer. @@ -52,7 +52,7 @@ file-ending-in-backslash-mmap: .PHONY # Since parse.c 1.511 from 2020-12-22, an assertion in ParseGetLine failed # for lines that contained trailing whitespace. Worked around in parse.c -# 1.513, properly fixed in parse.c 1.514. +# 1.513, properly fixed in parse.c 1.514 from 2020-12-22. line-with-trailing-whitespace: .PHONY @printf '%s' 'VAR=$@ ' > opt-file-trailing-whitespace @${MAKE} -r -f opt-file-trailing-whitespace -V VAR