This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Sat, 28 Feb 2004 14:24:35 +0000 (14:24 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 28 Feb 2004 14:24:35 +0000 (14:24 +0000)
[ 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..)

ext/Cwd/Changes
ext/Cwd/t/cwd.t
lib/Cwd.pm

index b6d8ce5..01d20ed 100644 (file)
@@ -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
index 92ec184..7256456 100644 (file)
@@ -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: {
index 51ca5b6..2757fd6 100644 (file)
@@ -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