From f9ba22e02924e0a869a6e40ef4a70ee884d1ec46 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 4 Aug 2018 17:35:10 -0400 Subject: [PATCH] * tests/scripts/functions/wildcard: [SV 52018] Test dangling symlink. --- tests/scripts/functions/wildcard | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/scripts/functions/wildcard b/tests/scripts/functions/wildcard index ad96473d..3ada1953 100644 --- a/tests/scripts/functions/wildcard +++ b/tests/scripts/functions/wildcard @@ -100,10 +100,11 @@ unlink('xxx.yyy'); run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!, '', "file=\n"); -# TEST #6: check for wildcards matching directories -# See SV 53465 - if ($port_type ne 'W32' && eval { symlink("",""); 1 }) { + + # TEST #6: check for wildcards matching directories + # See SV 53465 + my $dir = '__rdir'; my $lnk = '__ldir'; mkdir($dir, 0777); @@ -113,6 +114,14 @@ if ($port_type ne 'W32' && eval { symlink("",""); 1 }) { unlink($lnk); rmdir($dir); + + # Test for dangling symlinks + + symlink($dir, $lnk); + + run_make_test(qq!all: ; \@echo \$(wildcard $lnk)!, '', "$lnk"); + + unlink($lnk); } 1;