Module Name: src
Committed By: rillig
Date: Sun Oct 4 20:06:49 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: varname-dot-curdir.mk
Log Message:
make(1): add test for assigning to .CURDIR
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/varname-dot-curdir.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/unit-tests/varname-dot-curdir.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-curdir.mk:1.2 src/usr.bin/make/unit-tests/varname-dot-curdir.mk:1.3
--- src/usr.bin/make/unit-tests/varname-dot-curdir.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/varname-dot-curdir.mk Sun Oct 4 20:06:48 2020
@@ -1,8 +1,25 @@
-# $NetBSD: varname-dot-curdir.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varname-dot-curdir.mk,v 1.3 2020/10/04 20:06:48 rillig Exp $
#
# Tests for the special .CURDIR variable.
# TODO: Implementation
+# As of 2020-10-04, assigning the result of a shell command to .CURDIR tries
+# to add the shell command to the .PATH instead of the output of the shell
+# command. Since "echo /" does not exist, the .PATH is left unmodified.
+# See Parse_DoVar at the very bottom.
+.CURDIR!= echo /
+.if ${.PATH:M/}
+. error
+.endif
+
+# A normal assignment works fine, as does a substitution assignment.
+# Appending to .CURDIR does not make sense, therefore it doesn't matter that
+# this code path is buggy as well.
+.CURDIR= /
+.if !${.PATH:M/}
+. error
+.endif
+
all:
@:;