Revision history for Perl distribution PathTools.
+3.09 Tue Jun 14 20:36:50 CDT 2005
+
+ - Added some block delimiters (brackets) in the Perl_getcwd_sv() XS
+ function, which were necessary to separate the variable
+ declarations from the statements when HAS_GETCWD is not
+ defined. [Yves]
+
+ - Apparently the _NT_cwd() routine is never defined externally like I
+ thought it was, so I simplified the code around it.
+
+ - When cwd() is implemented using the _backtick_pwd() function, it
+ sometimes could create accidental undef entries in %ENV under perl
+ 5.6, because local($hash{key}) is somewhat broken. This is now
+ fixed with an appropriate workaround. [Neil Watkiss]
+
3.08 Sat May 28 10:10:29 CDT 2005
- Fixed a test failure with fast_abs_path() on Windows - it was
}
#else
-
+ {
Stat_t statbuf;
int orig_cdev, orig_cino, cdev, cino, odev, oino, tdev, tino;
int namelen, pathlen=0;
}
return TRUE;
+ }
#endif
#else
use Test::More;
require VMS::Filespec if $^O eq 'VMS';
-my $tests = 28;
+my $tests = 29;
# _perl_abs_path() currently only works when the directory separator
# is '/', so don't test it when it won't work.
my $EXTRA_ABSPATH_TESTS = ($Config{prefix} =~ m/\//) && $^O ne 'cygwin';
ok( !defined(&abs_path), ' nor abs_path()' );
ok( !defined(&fast_abs_path), ' nor fast_abs_path()');
+{
+ my @fields = qw(PATH IFS CDPATH ENV BASH_ENV);
+ my $before = grep exists $ENV{$_}, @fields;
+ cwd();
+ my $after = grep exists $ENV{$_}, @fields;
+ is($before, $after, "cwd() shouldn't create spurious entries in %ENV");
+}
# XXX force Cwd to bootsrap its XSUBs since we have set @INC = "../lib"
# XXX and subsequent chdir()s can make them impossible to find
use Exporter;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
-$VERSION = '3.08';
+$VERSION = '3.09';
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
# The 'natural and safe form' for UNIX (pwd may be setuid root)
sub _backtick_pwd {
- local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};
+ # Localize %ENV entries in a way that won't create new hash keys
+ my @localize = grep exists $ENV{$_}, qw(PATH IFS CDPATH ENV BASH_ENV);
+ local @ENV{@localize};
+
my $cwd = `$pwd_cmd`;
# Belt-and-suspenders in case someone said "undef $/".
local $/ = "\n";
return $ENV{'PWD'};
}
-*_NT_cwd = \&_win32_cwd if (!defined &_NT_cwd &&
- defined &Win32::GetCwd);
-
-*_NT_cwd = \&_os2_cwd unless defined &_NT_cwd;
+*_NT_cwd = defined &Win32::GetCwd ? \&_win32_cwd : \&_os2_cwd;
sub _dos_cwd {
if (!defined &Dos::GetCwd) {
use strict;
use vars qw(@ISA $VERSION);
-$VERSION = '3.08';
+$VERSION = '3.09';
$VERSION = eval $VERSION;
my %module = (MacOS => 'Mac',