Module Name: src
Committed By: apb
Date: Tue Sep 9 10:22:27 UTC 2014
Modified Files:
src/usr.bin/make/unit-tests: escape.exp escape.mk
Log Message:
Add a test for backslash-newline at the very end of a command script.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/escape.exp
cvs rdiff -u -r1.9 -r1.10 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.6 src/usr.bin/make/unit-tests/escape.exp:1.7
--- src/usr.bin/make/unit-tests/escape.exp:1.6 Tue Sep 9 10:11:20 2014
+++ src/usr.bin/make/unit-tests/escape.exp Tue Sep 9 10:22:27 2014
@@ -71,6 +71,10 @@ echo :'first line\
only one tab should be elided, second tab remains'
:first line\
only one tab should be elided, second tab remains
+cmd-1bsnl-eof
+echo :'command ending with backslash-newline'; \
+
+:command ending with backslash-newline
cmd-2bsnl
echo take one\\
take one\
Index: src/usr.bin/make/unit-tests/escape.mk
diff -u src/usr.bin/make/unit-tests/escape.mk:1.9 src/usr.bin/make/unit-tests/escape.mk:1.10
--- src/usr.bin/make/unit-tests/escape.mk:1.9 Tue Sep 9 10:11:20 2014
+++ src/usr.bin/make/unit-tests/escape.mk Tue Sep 9 10:22:27 2014
@@ -1,4 +1,4 @@
-# $Id: escape.mk,v 1.9 2014/09/09 10:11:20 apb Exp $
+# $Id: escape.mk,v 1.10 2014/09/09 10:22:27 apb Exp $
#
# Test backslash escaping.
@@ -204,6 +204,17 @@ third line':
echo :'first line\
only one tab should be elided, second tab remains'
+# When backslash-newline appears at the end of a command script,
+# both the backslash and the newline should be passed to the shell.
+# The shell should elide the backslash-newline.
+#
+all: cmd-1bsnl-eof
+cmd-1bsnl-eof:
+ @echo ${.TARGET}
+ echo :'command ending with backslash-newline'; \
+
+# above line must be blank
+
# Double-backslash-newline in a command.
# Both backslashes are retained, but the newline is not escaped.
# XXX: This may differ from POSIX, but matches gmake.