From e364498113e145b5ac424325e3903cc2287d7e7f Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 8 Apr 2014 18:25:27 -0400 Subject: [SV 41983] Support omitting the text argument to $(file ...) Reported by Tim Murphy * 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. --- tests/scripts/functions/file | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/scripts/functions/file b/tests/scripts/functions/file index 9a4cd02..55eb58a 100644 --- a/tests/scripts/functions/file +++ b/tests/scripts/functions/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'); -- cgit v1.2.3