From 3f28ec2f58c3defebd1d9e66ec0ae653e78d88d5 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 6 May 2023 16:12:11 -0400 Subject: * src/read.c (eval): [SV 40942] Allow targets named "load" Previously "load:" worked but "load :" failed. Allow the latter as well. This doesn't fix all issues; "load foo :" is still treated as a load operation for "foo" and ":". Avoids SV 50413 as well. * tests/scripts/features/load: Write tests. --- tests/scripts/features/load | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/scripts/features/load b/tests/scripts/features/load index b462ed9c..3713f944 100644 --- a/tests/scripts/features/load +++ b/tests/scripts/features/load @@ -144,7 +144,25 @@ all: ; @echo pre=$(PRE) post=$(POST) $(TESTLOAD) testload.so: testload.c ; @echo "rebuilding $@"; !.$sobuild, '', "pre= post=testload.so implicit\n"); -unlink(qw(testload.c testload.so)) unless $keep; +# Check using load as a target or variable name +run_make_test(q! +load: ; @echo $@ +-load&: ; @echo $@ +!, + "", "load\n"); + +run_make_test(q! +load : ; @echo $@ +-load &: ; echo $@ +!, + "", "load\n"); + +run_make_test(q! +load = @echo $@ +all: ; $(load) +load |: ; echo $@ +!, + "", "all\n"); # This tells the test driver that the perl test script executed properly. 1; -- cgit v1.2.1