Module Name:    src
Committed By:   rillig
Date:           Sun Jul 19 15:16:22 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk

Log Message:
make(1): add test for stray dollar signs in :@ modifier


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/modmisc.exp
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/modmisc.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/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.14 src/usr.bin/make/unit-tests/modmisc.exp:1.15
--- src/usr.bin/make/unit-tests/modmisc.exp:1.14	Sat Jul  4 22:17:09 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp	Sun Jul 19 15:16:22 2020
@@ -32,6 +32,9 @@ make: Unclosed substitution for  (, miss
 :x__ 3 x__ 3:
 :+one+ +two+ +three+:
 mod-at-resolve:w1d2d3w w2i3w w1i2d3 2i${RES3}w w1d2d3 2i${RES3} 1i${RES2}w:
+mod-at-dollar:(1) (2) (3).
+mod-at-dollar:(1) (2) (3).
+mod-at-dollar:() () ().
 mod-subst-dollar:$1:
 mod-subst-dollar:$2:
 mod-subst-dollar:$3:

Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.12 src/usr.bin/make/unit-tests/modmisc.mk:1.13
--- src/usr.bin/make/unit-tests/modmisc.mk:1.12	Sat Jul  4 18:54:18 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Sun Jul 19 15:16:22 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.12 2020/07/04 18:54:18 rillig Exp $
+# $Id: modmisc.mk,v 1.13 2020/07/19 15:16:22 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -16,7 +16,7 @@ MOD_OPT=@d@$${exists($$d):?$$d:$${d:S,/u
 MOD_SEP=S,:, ,g
 
 all:	modvar modvarloop modsysv mod-HTE emptyvar undefvar
-all:	mod-S mod-C mod-at-varname mod-at-resolve
+all:	mod-S mod-C mod-at-varname mod-at-resolve mod-at-dollar
 all:	mod-subst-dollar mod-loop-dollar
 
 modsysv:
@@ -95,6 +95,14 @@ RES3=		3
 mod-at-resolve:
 	@echo $@:${RESOLVE:@v@w${v}w@:Q}:
 
+# As of 2020-07-19, the variable name of the :@ modifier may end with one
+# or two dollar signs, which are silently ignored.  There's no point in
+# allowing a dollar sign in that position.
+mod-at-dollar:
+	@echo $@:${1 2 3:L:@v$@($v)@:Q}.
+	@echo $@:${1 2 3:L:@v$$@($v)@:Q}.
+	@echo $@:${1 2 3:L:@v$$$@($v)@:Q}.
+
 # No matter how many dollar characters there are, they all get merged
 # into a single dollar by the :S modifier.
 mod-subst-dollar:

Reply via email to