Subject: | Windows style path errors |
Windows b0rks due to the fact that the directory separator is '\' not
'/'. Regex matches with plain '\' don't work ;)
Patch attached to fix this :)
Subject: | windows.patch |
--- File-ShareDir-0.03/lib/File/ShareDir.pm Fri Jan 27 10:36:44 2006
+++ File-ShareDir-0.03-barbie/lib/File/ShareDir.pm Tue Mar 7 18:51:36 2006
@@ -110,10 +110,11 @@
use Params::Util '_CLASS';
use Class::Inspector ();
-use vars qw{$VERSION $IS_MACOS @EXPORT_OK %EXPORT_TAGS};
+use vars qw{$VERSION $IS_MACOS $IS_WIN32 @EXPORT_OK %EXPORT_TAGS};
BEGIN {
$VERSION = '0.03';
$IS_MACOS = $^O eq 'MacOS';
+ $IS_WIN32 = $^O eq 'MSWin32';
@EXPORT_OK = qw{dist_dir dist_file module_dir module_file};
%EXPORT_TAGS = (
ALL => [ @EXPORT_OK ],
@@ -189,7 +190,9 @@
my $module = _MODULE(shift);
my $short = Class::Inspector->filename($module);
my $long = Class::Inspector->loaded_filename($module);
- $short =~ tr{/} {:} if $IS_MACOS;
+ $short =~ tr{/} {:} if $IS_MACOS;
+ $short =~ tr{\\} {/} if $IS_WIN32;
+ $long =~ tr{\\} {/} if $IS_WIN32;
substr( $short, -3, 3, '' );
$long =~ m{^(.*)$short\.pm\z}s or die("Failed to find base dir");
my $dir = File::Spec->catdir( "$1", 'auto', $short );