summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-02-28 14:24:35 +0000
committerNicholas Clark <nick@ccl4.org>2004-02-28 14:24:35 +0000
commitec391a6a8e7b5a7f2f1de232657a329bfa02e4b3 (patch)
tree10fdd1fd14cd5178d99efedbf74a9fb48fd657f6
parent5933a1fc9c7aceff3a32362d5deff18e0c6f685e (diff)
downloadperl-ec391a6a8e7b5a7f2f1de232657a329bfa02e4b3.tar.gz
Integrate:
[ 22056] Upgrade to Cwd 2.13 [ 22112] Upgrade to Cwd 2.14. [ 22403] Assimilate Cwd 2.15 from CPAN p4raw-link: @22403 on //depot/perl: 02cc4877b974f74ba7f16bace1ce676269cf2839 p4raw-link: @22112 on //depot/perl: ad78113d988ec1b364801653dfe48de85db425e6 p4raw-link: @22056 on //depot/perl: 889f7a4f8452140cca0c6ad9df71017733139f90 p4raw-id: //depot/maint-5.8/perl@22405 p4raw-integrated: from //depot/perl@22112 'ignore' ext/Cwd/Changes lib/Cwd.pm (@22056..) p4raw-integrated: from //depot/perl@22056 'ignore' ext/Cwd/t/cwd.t (@21972..)
-rw-r--r--ext/Cwd/Changes21
-rw-r--r--ext/Cwd/t/cwd.t44
-rw-r--r--lib/Cwd.pm29
3 files changed, 55 insertions, 39 deletions
diff --git a/ext/Cwd/Changes b/ext/Cwd/Changes
index b6d8ce54c8..01d20ede3c 100644
--- a/ext/Cwd/Changes
+++ b/ext/Cwd/Changes
@@ -1,5 +1,26 @@
Revision history for Perl extension Cwd.
+2.15 Fri Jan 16 08:09:44 CST 2004
+
+ - Fixed a problem on static perl builds - while creating
+ Makefile.aperl, it was loading a mismatched version of Cwd from
+ blib/ . [Reported by Blair Zajac]
+
+2.14 Thu Jan 8 18:51:08 CST 2004
+
+ - We now use File::Spec->canonpath() and properly-escaped regular
+ expressions when comparing paths in the regression tests. This
+ fixes some testing failures in 2.13 on non-Unix platforms. No
+ changes were made in the actual Cwd module code. [Steve Hay]
+
+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 92ec184ff0..7256456e98 100644
--- a/ext/Cwd/t/cwd.t
+++ b/ext/Cwd/t/cwd.t
@@ -11,7 +11,7 @@ use warnings;
use File::Spec;
use File::Path;
-use Test::More tests => 16;
+use Test::More tests => 20;
my $IsVMS = $^O eq 'VMS';
my $IsMacOS = $^O eq 'MacOS';
@@ -90,28 +90,20 @@ 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 = quotemeta 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()');
-like(fastcwd(), qr|$want$|, ' + fastcwd()');
-like(fastgetcwd(), qr|$want$|, ' + fastgetcwd()');
+foreach my $func (qw(cwd getcwd fastcwd fastgetcwd)) {
+ my $result = eval "$func()";
+ is $@, '';
+ like( File::Spec->canonpath($result), qr|$want$|, "$func()" );
+}
# Cwd::chdir should also update $ENV{PWD}
-like($ENV{PWD}, qr|$want$|, 'Cwd::chdir() updates $ENV{PWD}');
+like(File::Spec->canonpath($ENV{PWD}), qr|$want$|, 'Cwd::chdir() updates $ENV{PWD}');
my $updir = File::Spec->updir;
Cwd::chdir $updir;
print "#$ENV{PWD}\n";
@@ -126,14 +118,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 51ca5b6f54..2757fd6b3a 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -1,4 +1,5 @@
package Cwd;
+$VERSION = $VERSION = '2.15';
=head1 NAME
@@ -129,6 +130,12 @@ C<fast_abs_path()>.
=back
+=head1 AUTHOR
+
+Originally by the perl5-porters.
+
+Now maintained by Ken Williams <KWILLIAMS@cpan.org>
+
=head1 SEE ALSO
L<File::chdir>
@@ -137,9 +144,7 @@ L<File::chdir>
use strict;
use Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-
-$VERSION = '2.12';
+use vars qw(@ISA @EXPORT @EXPORT_OK);
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
@@ -178,21 +183,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