From d8ab1deaa025fbf9736ada9d709314d9a67b2369 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 21 Jun 2023 10:09:45 +0100 Subject: [PATCH] mason/.perl-lib/TrivGal.pm: Explicitly ignore values from `split_path'. We frequently don't want all of the returns from `split_path'; indeed, I think the BASE name is only used in one place. Explicitly ignore these by assigning to `undef' to make it clear what we do care about. --- mason/.perl-lib/TrivGal.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mason/.perl-lib/TrivGal.pm b/mason/.perl-lib/TrivGal.pm index 2d65be5..96f66f1 100644 --- a/mason/.perl-lib/TrivGal.pm +++ b/mason/.perl-lib/TrivGal.pm @@ -257,7 +257,7 @@ package TrivGal::Image { $m->interp->apply_escapes("$SCRIPTURL/$path", "u") . "?scale=$scale"; } else { - my ($dir, $base, $ext) = TrivGal::split_path $thumb; + my ($dir, undef, $ext) = TrivGal::split_path $thumb; my $ty = $TYPE{lc $ext} or die "unknown type `$ext'"; my $img = $me->{img}; @@ -344,7 +344,7 @@ sub listdir ($) { die "can't index a folder" if $indexp; } else { $list = \@f; - my ($dir, $base, $ext) = split_path $name; + my (undef, undef, $ext) = split_path $name; die "unknown image type" unless $TYPE{lc $ext}; if ($indexp) { die "two index images" if defined $ix; @@ -366,7 +366,7 @@ sub listdir ($) { closedir $d; ENT: for my $e (sort @e) { - my ($dir, $base, $ext) = split_path $e; + my (undef, undef, $ext) = split_path $e; my $dotp = $e =~ /^\./; my $st = stat "$path/$e"; my $list = undef; -- 2.11.0