Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/pkgsrc/pkgtools/pkglint/files/Attic/mktypes_test.go,v rcsdiff: /ftp/cvs/cvsroot/pkgsrc/pkgtools/pkglint/files/Attic/mktypes_test.go,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.11 retrieving revision 1.12 diff -u -p -r1.11 -r1.12 --- pkgsrc/pkgtools/pkglint/files/Attic/mktypes_test.go 2019/06/10 19:51:57 1.11 +++ pkgsrc/pkgtools/pkglint/files/Attic/mktypes_test.go 2019/06/30 20:56:19 1.12 @@ -64,7 +64,7 @@ func (s *Suite) Test_MkVarUseModifier_Ch mkline := t.NewMkLine("filename.mk", 123, "\t${VAR:}") n := 0 - mkline.ForEachUsed(func(varUse *MkVarUse, time vucTime) { + mkline.ForEachUsed(func(varUse *MkVarUse, time VucTime) { n += 100 for _, mod := range varUse.modifiers { mod.ChangesWords() @@ -151,3 +151,16 @@ func (s *Suite) Test_MkVarUseModifier_Su c.Check(ok, equals, true) c.Check(result, equals, "to a to b") } + +// Since the replacement text is not a simple string, the :C modifier +// cannot be treated like the :S modifier. The variable could contain +// one of the special characters that would need to be escaped in the +// replacement text. +func (s *Suite) Test_MkVarUseModifier_Subst__C_with_complex_replacement(c *check.C) { + mod := MkVarUseModifier{"C,from,${VAR},"} + + result, ok := mod.Subst("from a to b") + + c.Check(ok, equals, false) + c.Check(result, equals, "") +}