aboutsummaryrefslogtreecommitdiff
path: root/testsuite/make.tests
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-03-11 09:12:47 +0000
committerRon Yorston <rmy@pobox.com>2024-03-11 09:20:47 +0000
commit1eee84b800408e53e659ff303eaa08ee09d67c3b (patch)
tree052da978f08edf8915e10fafe9d9813a9b57d6f1 /testsuite/make.tests
parent912d65cba97db3d27a747decb1c1635aece8bb90 (diff)
downloadbusybox-w32-1eee84b800408e53e659ff303eaa08ee09d67c3b.tar.gz
busybox-w32-1eee84b800408e53e659ff303eaa08ee09d67c3b.tar.bz2
busybox-w32-1eee84b800408e53e659ff303eaa08ee09d67c3b.zip
make: allow '#' to be escaped with a backslash
POSIX doesn't allow the '#' comment marker to be escaped, though some implementations do. As a non-POSIX extension allow '#' to be escaped with a preceding backslash. It isn't necessary to escape '#' in macro expansions or command lines: these cases are covered by an existing extension. Commit 0aceca867 (make: comments in macro expansions and command lines) Adds 16-32 bytes. (pdpmake GitHub issue 38)
Diffstat (limited to '')
-rwxr-xr-xtestsuite/make.tests9
1 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/make.tests b/testsuite/make.tests
index 745a840f3..1fc95a8d2 100755
--- a/testsuite/make.tests
+++ b/testsuite/make.tests
@@ -459,6 +459,15 @@ target:
459 : hash $(hash) hash 459 : hash $(hash) hash
460' 460'
461 461
462# A '#' character can be escaped with a backslash
463testing "make backslash-escaped hash isn't a comment" \
464 "make -f -" \
465 ": hash # hash\n" "" '
466hash = \#
467target:
468 : hash $(hash) hash
469'
470
462# A '#' character in a command line doesn't start a comment 471# A '#' character in a command line doesn't start a comment
463testing "make hash in command line isn't a comment" \ 472testing "make hash in command line isn't a comment" \
464 "make -f -" \ 473 "make -f -" \