Subject: | File::Spec->catpath used in error? |
The code to create the search path for the effective_tld_names.dat in
_parse_data_file looks broken to me - the initial catfile is weird, and
the subsequent catpath calls look like they're meant to be catdirs instead?
Suggested patch attached.
Cheers,
Gavin
Subject: | Domain-PublicSuffix-0.04-fix-catdir.patch |
From 6efae2f5fae859fe464f116c3839c2c3bc8c6131 Mon Sep 17 00:00:00 2001
From: Gavin Carr <gavin@openfusion.com.au>
Date: Mon, 30 Apr 2012 20:13:46 +1000
Subject: [PATCH] Fix File::Spec->catdir path issues.
---
lib/Domain/PublicSuffix.pm | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/Domain/PublicSuffix.pm b/lib/Domain/PublicSuffix.pm
index 6ef4702..c56a6bc 100755
--- a/lib/Domain/PublicSuffix.pm
+++ b/lib/Domain/PublicSuffix.pm
@@ -220,11 +220,10 @@ sub _parse_data_file {
} else {
my @paths = (
- File::Spec->catfile(qw/ etc /),
- File::Spec->catpath(qw/ etc /),
- File::Spec->catpath(qw/ usr etc /),
- File::Spec->catpath(qw/ usr local etc /),
- File::Spec->catpath(qw/ opt local etc /),
+ File::Spec->catdir(File::Spec->rootdir, qw/ etc /),
+ File::Spec->catdir(File::Spec->rootdir, qw/ usr etc /),
+ File::Spec->catdir(File::Spec->rootdir, qw/ usr local etc /),
+ File::Spec->catdir(File::Spec->rootdir, qw/ opt local etc /),
);
foreach my $path (@paths) {
$path = File::Spec->catfile( $path, "effective_tld_names.dat" );
@@ -405,4 +404,4 @@ under the same terms as Perl itself.
=cut
-1;
\ No newline at end of file
+1;
--
1.7.1