Skip to content

Commit

Permalink
Bugfix: sort globbed files
Browse files Browse the repository at this point in the history
Consider something like this in the config file:

    extension jpg
    extension tif

When working with a directory that contains files of both types the
files previously wouldn't get sorted by file name but by extension,
apparently because of how file globbing with a pattern like
`*.{jpg,tif}` works. This commit fixes this, sorting files like
expected.
  • Loading branch information
marhop committed Jul 5, 2019
1 parent d9caabb commit 325306b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion verso.pl
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ sub init_files {
if (-e $path) {
$path = normalize_file_path($path);
(undef, $directory, undef) = fileparse($path);
@files = map { decode 'utf8', $_ }
@files = sort map { decode 'utf8', $_ }
grep { ! -d } glob "$directory*.{$ext}";
if (@files) {
$index = -d $path ? 0 : first_index($path, @files);
Expand Down

0 comments on commit 325306b

Please sign in to comment.