File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -400,6 +400,7 @@ sub candidate_pathnames {
400400 opendir (my $dir_handle , $dir ) or next ;
401401 my @dir_files = readdir ($dir_handle );
402402 closedir ($dir_handle );
403+ my @dir_paths ;
403404 for my $local_file (@dir_files ) {
404405 for my $regex_pair (@regexes ) {
405406 my ($i_regex , $regex ) = @$regex_pair ;
@@ -409,7 +410,8 @@ sub candidate_pathnames {
409410 if ($local_file =~ m /$regex / ) {
410411 # if we are only interested in the first match, return it:
411412 return ($full_file ) if $options {findfirst };
412- push (@paths , $full_file ); } } } } }
413+ push (@dir_paths , $full_file ); } } } }
414+ push (@paths , sort @dir_paths ); }
413415 # Fallback: if no strict matches were found, return any existing case-insensitive matches
414416 # Defer the -f check until we are sure we need it, to keep the usual cases fast.
415417 return @paths ? @paths : @nocase_paths ; }
You can’t perform that action at this time.
0 commit comments