Revision history for Perl extension Cwd.
+2.13 Fri Jan 2 22:29:42 CST 2004
+
+ - Changed a '//' comment to a '/* */' comment in the XS code, so that
+ it'll compile properly under ANSI C rules. [Jarkko Hietaniemi]
+
+ - Fixed a 1-character buffer overrun problem in the C code. [The BSD
+ people]
+
2.12 Fri Dec 19 17:04:52 CST 2003
- Fixed a bug on Cygwin - the output of realpath() should have been
}
my $Top_Test_Dir = '_ptrslt_';
-my $Test_Dir = "$Top_Test_Dir/_path_/_to_/_a_/_dir_";
-my $want = "t/$Test_Dir";
-if( $IsVMS ) {
- # translate the unixy path to VMSish
- $want =~ s|/|\.|g;
- $want .= '\]';
- $want = '((?i)' . $want . ')'; # might be ODS-2 or ODS-5
-} elsif ( $IsMacOS ) {
- $_ = ":$_" for ($Top_Test_Dir, $Test_Dir);
- s|/|:|g, s|$|:| for ($want, $Test_Dir);
-}
+my $Test_Dir = File::Spec->catdir($Top_Test_Dir, qw/_path_ _to_ _a_ _dir_/);
+my $want = File::Spec->catdir('t', $Test_Dir);
-mkpath(["$Test_Dir"], 0, 0777);
-Cwd::chdir "$Test_Dir";
+mkpath([$Test_Dir], 0, 0777);
+Cwd::chdir $Test_Dir;
like(cwd(), qr|$want$|, 'chdir() + cwd()');
like(getcwd(), qr|$want$|, ' + getcwd()');
rmtree([$Top_Test_Dir], 0, 0);
-if ($IsVMS) {
- like($ENV{PWD}, qr|\b((?i)t)\]$|);
-}
-elsif ($IsMacOS) {
- like($ENV{PWD}, qr|\bt:$|);
-}
-else {
- like($ENV{PWD}, qr|\bt$|);
+{
+ my $check = ($IsVMS ? qr|\b((?i)t)\]$| :
+ $IsMacOS ? qr|\bt:$| :
+ qr|\bt$| );
+
+ like($ENV{PWD}, $check);
}
SKIP: {
use Exporter;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-$VERSION = '2.12';
+$VERSION = '2.13';
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
# are safe. This prevents _backtick_pwd() consulting $ENV{PATH}
# so everything works under taint mode.
my $pwd_cmd;
-foreach my $try (qw(/bin/pwd /usr/bin/pwd)) {
+foreach my $try ('/bin/pwd',
+ '/usr/bin/pwd',
+ '/QOpenSys/bin/pwd', # OS/400 PASE.
+ ) {
+
if( -x $try ) {
$pwd_cmd = $try;
last;
}
}
unless ($pwd_cmd) {
- if (-x '/QOpenSys/bin/pwd') { # OS/400 PASE.
- $pwd_cmd = '/QOpenSys/bin/pwd' ;
- } else {
- # Isn't this wrong? _backtick_pwd() will fail if somenone has
- # pwd in their path but it is not /bin/pwd or /usr/bin/pwd?
- # See [perl #16774]. --jhi
- $pwd_cmd = 'pwd';
- }
+ # Isn't this wrong? _backtick_pwd() will fail if somenone has
+ # pwd in their path but it is not /bin/pwd or /usr/bin/pwd?
+ # See [perl #16774]. --jhi
+ $pwd_cmd = 'pwd';
}
# Lazy-load Carp