File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use warnings;
1515
1616use LaTeXML::Util::Pathname;
1717use File::Spec::Functions qw( catfile) ;
18- use File::Path qw( rmtree) ;
18+ use File::Path qw( rmtree) ;
1919use IO::String;
2020use Archive::Zip qw( :CONSTANTS :ERROR_CODES) ;
2121
@@ -250,7 +250,7 @@ sub get_archive {
250250 # or Fatal('expected', 'directory', undef,
251251 # "Expected a directory to archive '$directory':", $@);
252252 or (print STDERR ' Fatal:expected:directory Failed to compress directory \' $directory\' : $@' );
253- my @entries = grep { / ^[^.]/ } readdir ($dirhandle );
253+ my @entries = sort ( grep { / ^[^.]/ } readdir ($dirhandle ) );
254254 closedir $dirhandle ;
255255 my @files = grep { !/$archive_file_exclusion_regex / && -f pathname_concat($directory , $_ ) } @entries ;
256256 my @subdirs = grep { -d File::Spec-> catdir($directory , $_ ) } @entries ;
Original file line number Diff line number Diff line change @@ -399,6 +399,7 @@ sub candidate_pathnames {
399399 opendir (DIR, $dir ) or next ;
400400 my @dir_files = readdir (DIR);
401401 closedir (DIR);
402+ my @dir_paths ;
402403 for my $local_file (@dir_files ) {
403404 for my $regex_pair (@regexes ) {
404405 my ($i_regex , $regex ) = @$regex_pair ;
@@ -408,7 +409,8 @@ sub candidate_pathnames {
408409 if ($local_file =~ m /$regex / ) {
409410 # if we are only interested in the first match, return it:
410411 return ($full_file ) if $options {findfirst };
411- push (@paths , $full_file ); } } } } }
412+ push (@dir_paths , $full_file ); } } } }
413+ push (@paths , sort @dir_paths ); }
412414 # Fallback: if no strict matches were found, return any existing case-insensitive matches
413415 # Defer the -f check until we are sure we need it, to keep the usual cases fast.
414416 return @paths ? @paths : @nocase_paths ; }
You can’t perform that action at this time.
0 commit comments