PERFORCE change 12209 for review
[email protected] (Chris Nandor) Tue, 25 Sep 2001 17:20:44 -0400
| Newsgroups | perl.perl5.changes.mac |
|---|---|
| Message-ID | <p05100320b7d6a59edd8b@[10.0.1.177]> |
Change 12209 by pudge@pudge-mobile on 2001/09/25 19:15:57
Sync up with File::Find from bleadperl.
Affected files ...
... //depot/maint-5.6/macperl/lib/File/Find.pm#5 edit
... //depot/maint-5.6/macperl/t/lib/filefind-taint.t#4 edit
Differences ...
==== //depot/maint-5.6/macperl/lib/File/Find.pm#5 (text) ====
Index: perl/lib/File/Find.pm
--- perl/lib/File/Find.pm.~1~ Tue Sep 25 13:30:05 2001
+++ perl/lib/File/Find.pm Tue Sep 25 13:30:05 2001
@@ -1,8 +1,8 @@
package File::Find;
+use 5.006;
use strict;
use warnings;
-use 5.6.0;
-our $VERSION = '1.01';
+our $VERSION = '1.02';
require Exporter;
require Cwd;
@@ -641,16 +641,14 @@
my $SE= [];
my $dir_name= $p_dir;
my $dir_pref;
- my $dir_rel;
+ my $dir_rel = $File::Find::current_dir;
my $tainted = 0;
if ($Is_MacOS) {
$dir_pref= ($p_dir =~ /:$/) ? $p_dir : "$p_dir:"; # preface
- $dir_rel= ':'; # directory name relative to current directory
}
else {
$dir_pref= ( $p_dir eq '/' ? '/' : "$p_dir/" );
- $dir_rel= '.'; # directory name relative to current directory
}
local ($dir, $name, $prune, *DIR);
@@ -809,12 +807,7 @@
if ( $nlink == -2 ) {
$name = $dir = $p_dir; # $File::Find::name / dir
- if ($Is_MacOS) {
- $_ = ':'; # $_
- }
- else {
- $_ = '.';
- }
+ $_ = $File::Find::current_dir;
&$post_process; # End-of-directory processing
}
elsif ( $nlink < 0 ) { # must be finddepth, report dirname now
@@ -865,7 +858,7 @@
my $dir_name = $p_dir;
my $dir_pref;
my $loc_pref;
- my $dir_rel;
+ my $dir_rel = $File::Find::current_dir;
my $byd_flag; # flag for pending stack entry if $bydepth
my $tainted = 0;
my $ok = 1;
@@ -873,11 +866,9 @@
if ($Is_MacOS) {
$dir_pref = ($p_dir =~ /:$/) ? "$p_dir" : "$p_dir:";
$loc_pref = ($dir_loc =~ /:$/) ? "$dir_loc" : "$dir_loc:";
- $dir_rel = ':'; # directory name relative to current directory
} else {
$dir_pref = ( $p_dir eq '/' ? '/' : "$p_dir/" );
$loc_pref = ( $dir_loc eq '/' ? '/' : "$dir_loc/" );
- $dir_rel = '.'; # directory name relative to current directory
}
local ($dir, $name, $fullname, $prune, *DIR);
==== //depot/maint-5.6/macperl/t/lib/filefind-taint.t#4 (text) ====
Index: perl/t/lib/filefind-taint.t
--- perl/t/lib/filefind-taint.t.~1~ Tue Sep 25 13:30:05 2001
+++ perl/t/lib/filefind-taint.t Tue Sep 25 13:30:05 2001
@@ -4,16 +4,14 @@
my %Expect_File = (); # what we expect for $_
my %Expect_Name = (); # what we expect for $File::Find::name/fullname
my %Expect_Dir = (); # what we expect for $File::Find::dir
-my $symlink_exists = eval { symlink("",""); 1 };
-my $cwd;
-my $cwd_untainted;
+my ($cwd, $cwd_untainted);
-use Config;
-
BEGIN {
chdir 't' if -d 't';
unshift @INC => '../lib';
+ require Config;
+
for (keys %ENV) { # untaint ENV
($ENV{$_}) = $ENV{$_} =~ /(.*)/;
}
@@ -35,7 +33,7 @@
$ENV{'PATH'} = join($sep,@path);
}
-
+my $symlink_exists = eval { symlink("",""); 1 };
if ( $symlink_exists ) { print "1..45\n"; }
else { print "1..27\n"; }
@@ -43,7 +41,6 @@
use File::Spec;
use Cwd;
-
cleanup();
find({wanted => sub { print "ok 1\n" if $_ eq 'if.t'; },
@@ -128,7 +125,6 @@
$File::Find::prune=1 if $_ eq 'faba';
}
-
sub simple_wanted {
print "# \$File::Find::dir => '$File::Find::dir'\n";
print "# \$_ => '$_'\n";
@@ -251,7 +247,6 @@
}
-
MkDir( dir_path('for_find'), 0770 );
CheckDie(chdir( dir_path('for_find')));
End of Patch.