[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:
Paul Smith
2014-04-08 18:25:27 -04:00
parent 85047eb904
commit e364498113
4 changed files with 41 additions and 19 deletions

View File

@@ -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');