Module Name: src Committed By: apb Date: Sun Aug 24 16:08:14 UTC 2014
Modified Files: src/usr.bin/make/unit-tests: escape.exp escape.mk Log Message: Our practice is that an even number of backslashes before a newline in a variable assignment simply stores the backslashes as part of the value, and treats the newline as though it was not escaped. This is compatible with GNU make. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/escape.exp cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/escape.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/escape.exp diff -u src/usr.bin/make/unit-tests/escape.exp:1.3 src/usr.bin/make/unit-tests/escape.exp:1.4 --- src/usr.bin/make/unit-tests/escape.exp:1.3 Sun Aug 24 15:10:13 2014 +++ src/usr.bin/make/unit-tests/escape.exp Sun Aug 24 16:08:14 2014 @@ -23,13 +23,13 @@ VAR1BSNLdA=:111 ${A}: VAR1BSNLc=:111: VAR1BSNLsc=:111: var-2bsnl -VAR2BSNL=:222\ 222=: -VAR2BSNLa=:222\ aaa=: -VAR2BSNLA=:222\ aaa=: -VAR2BSNLda=:222\ ${a}=: -VAR2BSNLdA=:222\ ${A}=: -VAR2BSNLc=:222\: -VAR2BSNLsc=:222\: +VAR2BSNL=:222\\: +VAR2BSNLa=:222\\: +VAR2BSNLA=:222\\: +VAR2BSNLda=:222\\: +VAR2BSNLdA=:222\\: +VAR2BSNLc=:222\\: +VAR2BSNLsc=:222\\: var-3bsnl VAR3BSNL=:333\\ 333=: VAR3BSNLa=:333\\ aaa=: Index: src/usr.bin/make/unit-tests/escape.mk diff -u src/usr.bin/make/unit-tests/escape.mk:1.6 src/usr.bin/make/unit-tests/escape.mk:1.7 --- src/usr.bin/make/unit-tests/escape.mk:1.6 Sun Aug 24 15:10:13 2014 +++ src/usr.bin/make/unit-tests/escape.mk Sun Aug 24 16:08:14 2014 @@ -1,4 +1,4 @@ -# $Id: escape.mk,v 1.6 2014/08/24 15:10:13 apb Exp $ +# $Id: escape.mk,v 1.7 2014/08/24 16:08:14 apb Exp $ # # Test backslash escaping. @@ -31,6 +31,11 @@ # Our practice, despite what POSIX might say, is that "\#" # in a variable assignment stores "#" as part of the value. # The "\" is not taken literally, and the "#" does not begin a comment. +# +# Also, our practice is that an even number of backslashes before a newline +# in a variable assignment simply stores the backslashes as part of the +# value, and treats the newline as though it was not escaped. This +# is compatible with GNU make. all: .PHONY # We will add dependencies like "all: yet-another-test" later. @@ -100,8 +105,7 @@ var-1bsnl: .PHONY __printvars \ VAR1BSNLc VAR1BSNLsc # Double-backslash-newline in a variable setting. -# First one should be taken literally, and last should escape the newline. -# XXX: Is the expected behaviour well defined? +# Both backslashes should be taken literally, and the newline is NOT escaped. # # The second lines below each end with '=' so that they will not # generate syntax errors regardless of whether or not they are @@ -125,11 +129,10 @@ VAR2BSNLsc = 222\\ all: var-2bsnl var-2bsnl: .PHONY __printvars \ VAR2BSNL VAR2BSNLa VAR2BSNLA VAR2BSNLda VAR2BSNLdA \ - VAR2BSNLc VARR2BSNLsc + VAR2BSNLc VAR2BSNLsc # Triple-backslash-newline in a variable setting. # First two should be taken literally, and last should escape the newline. -# XXX: Is the expected behaviour well defined? # # The second lines below each end with '=' so that they will not # generate syntax errors regardless of whether or not they are