From: Rafael Garcia-Suarez Date: Sun, 4 Jan 2004 20:45:31 +0000 (+0000) Subject: Upgrade to Cwd 2.13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=889f7a4f8452140cca0c6ad9df71017733139f90;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Cwd 2.13 p4raw-id: //depot/perl@22056 --- diff --git a/ext/Cwd/Changes b/ext/Cwd/Changes index b6d8ce5..c117944 100644 --- a/ext/Cwd/Changes +++ b/ext/Cwd/Changes @@ -1,5 +1,13 @@ 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 diff --git a/ext/Cwd/t/cwd.t b/ext/Cwd/t/cwd.t index 92ec184..394b4b5 100644 --- a/ext/Cwd/t/cwd.t +++ b/ext/Cwd/t/cwd.t @@ -90,20 +90,11 @@ SKIP: { } 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()'); @@ -126,14 +117,12 @@ print "#$ENV{PWD}\n"; 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: { diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 51ca5b6..9ad42e7 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -139,7 +139,7 @@ use strict; 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); @@ -178,21 +178,21 @@ eval { # 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