diff options
author | Paul Smith <psmith@gnu.org> | 2014-04-08 18:25:27 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2014-07-07 01:59:03 -0400 |
commit | e364498113e145b5ac424325e3903cc2287d7e7f (patch) | |
tree | e27af5556c7f8ff34393979ea4b2a3a206052202 /tests/scripts/functions/file | |
parent | 85047eb9044d4b72d50e6620c505c675d55ab98b (diff) | |
download | gunmake-e364498113e145b5ac424325e3903cc2287d7e7f.tar.gz |
[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.
Diffstat (limited to 'tests/scripts/functions/file')
-rw-r--r-- | tests/scripts/functions/file | 17 |
1 files changed, 17 insertions, 0 deletions
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'); |