Fix from Rich Felker <bugdal@aerifal.cx> on the musl mailing list.
* tests/scripts/functions/wildcard: Create a regression test for this.
/* If we shall match only directories use the information
provided by the dirent call if possible. */
if ((flags & GLOB_ONLYDIR)
- && d->d_type != DT_UNKNOWN && d->d_type != DT_DIR)
+ && d->d_type != DT_UNKNOWN && d->d_type != DT_DIR && d->d_type != DT_LNK)
continue;
#endif
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 }) {
+ my $dir = '__rdir';
+ my $lnk = '__ldir';
+ mkdir($dir, 0777);
+ symlink($dir, $lnk);
+
+ run_make_test(qq!all: ; \@echo \$(wildcard $lnk*/.)!, '', "$lnk/.");
+
+ unlink($lnk);
+ rmdir($dir);
+}
+
1;