Revision history for Perl distribution PathTools.
-3.21 Wed Oct 4 21:13:21 CDT 2006
+
+ - Fixed the t/crossplatform.t test on Win32 (and possibly other
+ volume-aware platforms) now that rel2abs() always adds a drive
+ letter. [Reported by several parties]
+
+3.21 - Wed Oct 4 21:16:43 2006
- Added a bunch of X<> tags to the File::Spec docs to help
podindex. [Gabor Szabo]
/*ABCDEFGHIJKLMNOPQRSTUVWXYZ*/
"01230120022455012623010202";
-static SV *sv_soundex (source)
- SV *source;
+static SV *sv_soundex (SV *source)
{
char *source_p;
char *source_end;
return SvREFCNT_inc(perl_get_sv("Text::Soundex::nocode", FALSE));
}
-static SV *sv_soundex_utf8 (source)
- SV *source;
+static SV *sv_soundex_utf8 (SV* source)
{
U8 *source_p;
U8 *source_end;
use Exporter;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
-$VERSION = '3.21';
+$VERSION = '3.22';
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
use strict;
use vars qw(@ISA $VERSION);
-$VERSION = '3.21';
+$VERSION = '3.22';
$VERSION = eval $VERSION;
my %module = (MacOS => 'Mac',
my($self,$path,$base) = @_;
$base = $self->_cwd() unless defined $base and length $base;
- for ($path, $base) { $_ = $self->canonpath($_) }
+ ($path, $base) = map $self->canonpath($_), $path, $base;
if (grep $self->file_name_is_absolute($_), $path, $base) {
- for ($path, $base) { $_ = $self->rel2abs($_) }
+ ($path, $base) = map $self->rel2abs($_), $path, $base;
}
else {
# save a couple of cwd()s if both paths are relative
- for ($path, $base) { $_ = $self->catdir('/', $_) }
+ ($path, $base) = map $self->catdir('/', $_), $path, $base;
}
my ($path_volume) = $self->splitpath($path, 1);
[ "FakeWin32->abs2rel('C:\\Windows\\System32', 'C:\\')", 'Windows\System32' ],
[ "FakeWin32->abs2rel('\\\\computer2\\share3\\foo.txt', '\\\\computer2\\share3')", 'foo.txt' ],
[ "FakeWin32->abs2rel('C:\\one\\two\\t\\asd1\\', 't\\asd\\')", '..\\asd1' ],
+[ "FakeWin32->abs2rel('\\one\\two', 'A:\\foo')", 'C:\\one\\two' ],
[ "FakeWin32->rel2abs('temp','C:/')", 'C:\\temp' ],
[ "FakeWin32->rel2abs('temp','C:/a')", 'C:\\a\\temp' ],
my $v = $volumes{$platform} || '';
my $other_v = $other_vols{$platform} || '';
- # Fake out the rootdir on MacOS
+ # Fake out the environment on MacOS and Win32
no strict 'refs';
my $save_w = $^W;
$^W = 0;
local *{"File::Spec::Mac::rootdir"} = sub { "Macintosh HD:" };
+ local *{"File::Spec::Win32::_cwd"} = sub { "C:\\foo" };
$^W = $save_w;
use strict 'refs';
-
+
+
my ($file, $base, $result);
$base = $module->catpath($v, $module->catdir('', 'foo'), '');
$result = volumes_differ($module, $file, $base) ? $file : $module->catfile('bar', 'file');
is $module->abs2rel($file, $base), $result, "$platform->abs2rel($file, $base)";
- # abs2rel('/foo/bar', 'A:/foo') -> '/foo/bar'
+ # abs2rel('/foo/bar/file', 'A:/foo') -> '/foo/bar'
$file = $module->catpath('', $module->catdir($module->rootdir, 'foo', 'bar'), 'file');
$base = $module->catpath($v, $module->catdir($module->rootdir, 'foo'), '');
- $result = volumes_differ($module, $file, $base) ? $file : $module->catfile('bar', 'file');
+ $result = volumes_differ($module, $file, $base) ? $module->rel2abs($file) : $module->catfile('bar', 'file');
is $module->abs2rel($file, $base), $result, "$platform->abs2rel($file, $base)";
# abs2rel('/foo/bar', 'B:/foo') -> '/foo/bar'
$base = $module->catpath($other_v, $module->catdir($module->rootdir, 'foo'), '');
- $result = volumes_differ($module, $file, $base) ? $file : $module->catfile('bar', 'file');
+ $result = volumes_differ($module, $file, $base) ? $module->rel2abs($file) : $module->catfile('bar', 'file');
is $module->abs2rel($file, $base), $result, "$platform->abs2rel($file, $base)";
# abs2rel('/foo/bar', '/foo') -> 'bar'