Upgrade to Cwd 2.13
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 4 Jan 2004 20:45:31 +0000 (20:45 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 4 Jan 2004 20:45:31 +0000 (20:45 +0000)
p4raw-id: //depot/perl@22056

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

index b6d8ce5..c117944 100644 (file)
@@ -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
index 92ec184..394b4b5 100644 (file)
@@ -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: {
index 51ca5b6..9ad42e7 100644 (file)
@@ -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