From d11201de124aa7ae2512bfe59bd9a7b34bf5d3ae Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Thu, 21 Mar 2024 13:13:27 -0700 Subject: [PATCH] find_psl_file: fix duplicate share in path fixes #231 --- lib/Mail/DMARC/Base.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/Mail/DMARC/Base.pm b/lib/Mail/DMARC/Base.pm index f437aed4..e4cf82d6 100644 --- a/lib/Mail/DMARC/Base.pm +++ b/lib/Mail/DMARC/Base.pm @@ -194,14 +194,13 @@ sub find_psl_file { print "using $file for Public Suffix List\n" if $self->verbose; return $file; } - my $path; - foreach $path ($self->get_prefix('share/' . $file)) { ## no critic - last if ( -f $path && -r $path ); + + foreach my $path ($self->get_prefix($file)) { + if ( -f $path && -r $path ) { + print "using $path for Public Suffix List\n"; # if $self->verbose; + return $path; + } } - if ($path && -r $path) { - print "using $path for Public Suffix List\n" if $self->verbose; - return $path; - }; # Fallback to included suffic list return $self->get_sharefile('public_suffix_list');