Module Name: src Committed By: rillig Date: Mon Sep 6 21:18:55 UTC 2021
Modified Files: src/usr.bin/make/unit-tests: varmod-subst.mk Log Message: tests/make: test modifier ':S' with replacement '&' Before 2020-08-30, OpenBSD make incorrectly copied the anchors '^' and '$' to the replacement string. Just guard against this possible bug. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varmod-subst.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/varmod-subst.mk diff -u src/usr.bin/make/unit-tests/varmod-subst.mk:1.8 src/usr.bin/make/unit-tests/varmod-subst.mk:1.9 --- src/usr.bin/make/unit-tests/varmod-subst.mk:1.8 Fri May 14 19:37:16 2021 +++ src/usr.bin/make/unit-tests/varmod-subst.mk Mon Sep 6 21:18:55 2021 @@ -1,4 +1,4 @@ -# $NetBSD: varmod-subst.mk,v 1.8 2021/05/14 19:37:16 rillig Exp $ +# $NetBSD: varmod-subst.mk,v 1.9 2021/09/06 21:18:55 rillig Exp $ # # Tests for the :S,from,to, variable modifier. @@ -86,6 +86,19 @@ WORDS= sequences of letters . error The '.' seems to be interpreted as a wildcard of some kind. .endif +.if ${:Uvalue:S,^val,&,} != "value" +. error +.endif +.if ${:Uvalue:S,ue$,&,} != "value" +. error +.endif +.if ${:Uvalue:S,^val,&-&-&,} != "val-val-value" +. error +.endif +.if ${:Uvalue:S,ue$,&-&-&,} != "value-ue-ue" +. error +.endif + mod-subst: @echo $@: @echo :${:Ua b b c:S,a b,,:Q}: