mirror of
https://github.com/mirror/make.git
synced 2026-09-04 21:52:55 +08:00
[SV 17448] Ignore whitespace around $(file ...) names
The other issues related to whitespace reported in this bug are not addressed by this change. * src/functions.c (func_file): Strip whitespace from the start and end of the filename provided to the $(file ...) function. * tests/scripts/functions/file: Add tests for this. * tests/test_driver.pl: Use 3-arg version of open().
This commit is contained in:
@@ -23,7 +23,7 @@ define A
|
||||
a
|
||||
b
|
||||
endef
|
||||
$(file >> file.out,$(A))
|
||||
$(file >> file.out ,$(A))
|
||||
x:;@cat file.out
|
||||
!,
|
||||
'', "a\nb");
|
||||
@@ -219,4 +219,14 @@ run_make_test('$(file <)', '',
|
||||
run_make_test('$(file foo)', '',
|
||||
"#MAKEFILE#:1: *** file: invalid file operation: foo. Stop.\n", 512);
|
||||
|
||||
# SV 17448: check whitespace
|
||||
create_file('out1', "1\n");
|
||||
|
||||
run_make_test(q!
|
||||
all:;$(info $(file < out1 ))
|
||||
!,
|
||||
'', "1\n#MAKE#: 'all' is up to date.");
|
||||
|
||||
unlink('out1');
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user