* 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.
This commit is contained in:
Paul Smith
2023-05-06 16:12:11 -04:00
parent 24a84f99bb
commit 3f28ec2f58
2 changed files with 24 additions and 3 deletions

View File

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