mirror of
https://github.com/mirror/make.git
synced 2026-09-05 22:25:00 +08:00
[SV 41983] Support omitting the text argument to $(file ...)
Reported by Tim Murphy <tnmurphy@gmail.com> * function.c (func_file): Only write TEXT if it is not NULL. * NEWS, doc/make.texi: Document the new feature * tests/scripts/functions/file: Verify that the no-text version of $(file ...) works and doesn't add a newline.
This commit is contained in:
@@ -30,6 +30,23 @@ x:;@cat file.out
|
||||
|
||||
unlink('file.out');
|
||||
|
||||
# Test > with no content
|
||||
run_make_test(q!
|
||||
$(file >4touch)
|
||||
.PHONY:x
|
||||
x:;@cat 4touch
|
||||
!,
|
||||
'', '');
|
||||
|
||||
# Test >> with no content
|
||||
run_make_test(q!
|
||||
$(file >>4touch)
|
||||
.PHONY:x
|
||||
x:;@cat 4touch
|
||||
!,
|
||||
'', '');
|
||||
unlink('4touch');
|
||||
|
||||
# Test > to a read-only file
|
||||
touch('file.out');
|
||||
chmod(0444, 'file.out');
|
||||
|
||||
Reference in New Issue
Block a user