diff options
Diffstat (limited to 'lib/File/Find.pm')
-rw-r--r-- | lib/File/Find.pm | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/File/Find.pm b/lib/File/Find.pm index e2bb8ab48c..209e6bb0fa 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -63,7 +63,7 @@ The value should be a code reference. It is invoked just before leaving the currently processed directory. It is called in void context with no arguments. The name of the current directory is in $File::Find::dir. This hook is handy for summarizing a directory, such as calculating its disk -usage. When I<follow> or I<follow_fast> are in effect, C<preprocess> is a +usage. When I<follow> or I<follow_fast> are in effect, C<postprocess> is a no-op. =item C<follow> @@ -495,7 +495,7 @@ sub _find_opt { if ($Is_MacOS) { ($topdev,$topino,$topmode,$topnlink) = $follow ? stat $top_item : lstat $top_item; $top_item = ":$top_item" - if ( (-d _) && ($top_item =~ /^[^:]+\z/) ); + if ( (-d _) && ( $top_item !~ /:/ ) ); } else { $top_item =~ s|/\z|| unless $top_item eq '/'; @@ -515,7 +515,7 @@ sub _find_opt { else { $abs_dir = contract_name_Mac($cwd, $top_item); unless (defined $abs_dir) { - warn "Can't determine absolute path for $top_item (No such file or directory)\n"; + warn "Can't determine absolute path for $top_item (No such file or directory)\n" if $^W; next Proc_Top_Item; } } @@ -534,7 +534,7 @@ sub _find_opt { } $abs_dir= Follow_SymLink($abs_dir); unless (defined $abs_dir) { - warn "$top_item is a dangling symbolic link\n"; + warn "$top_item is a dangling symbolic link\n" if $^W; next Proc_Top_Item; } @@ -546,7 +546,7 @@ sub _find_opt { else { # no follow $topdir = $top_item; unless (defined $topnlink) { - warn "Can't stat $top_item: $!\n"; + warn "Can't stat $top_item: $!\n" if $^W; next Proc_Top_Item; } if (-d _) { @@ -583,7 +583,7 @@ sub _find_opt { } unless ($no_chdir || chdir $abs_dir) { - warn "Couldn't chdir $abs_dir: $!\n"; + warn "Couldn't chdir $abs_dir: $!\n" if $^W; next Proc_Top_Item; } @@ -652,7 +652,7 @@ sub _find_dir($$$) { } } unless (chdir $udir) { - warn "Can't cd to $udir: $!\n"; + warn "Can't cd to $udir: $!\n" if $^W; return; } } @@ -695,10 +695,10 @@ sub _find_dir($$$) { } unless (chdir $udir) { if ($Is_MacOS) { - warn "Can't cd to ($p_dir) $udir: $!\n"; + warn "Can't cd to ($p_dir) $udir: $!\n" if $^W; } else { - warn "Can't cd to (" . ($p_dir ne '/' ? $p_dir : '') . "/) $udir: $!\n"; + warn "Can't cd to (" . ($p_dir ne '/' ? $p_dir : '') . "/) $udir: $!\n" if $^W; } next; } @@ -713,7 +713,7 @@ sub _find_dir($$$) { # Get the list of files in the current directory. unless (opendir DIR, ($no_chdir ? $dir_name : $File::Find::current_dir)) { - warn "Can't opendir($dir_name): $!\n"; + warn "Can't opendir($dir_name): $!\n" if $^W; next; } @filenames = readdir DIR; @@ -883,7 +883,7 @@ sub _find_dir_symlnk($$$) { } $ok = chdir($updir_loc) unless ($p_dir eq $File::Find::current_dir); unless ($ok) { - warn "Can't cd to $updir_loc: $!\n"; + warn "Can't cd to $updir_loc: $!\n" if $^W; return; } } @@ -900,7 +900,7 @@ sub _find_dir_symlnk($$$) { # change (back) to parent directory (always untainted) unless ($no_chdir) { unless (chdir $updir_loc) { - warn "Can't cd to $updir_loc: $!\n"; + warn "Can't cd to $updir_loc: $!\n" if $^W; next; } } @@ -931,7 +931,7 @@ sub _find_dir_symlnk($$$) { } } unless (chdir $updir_loc) { - warn "Can't cd to $updir_loc: $!\n"; + warn "Can't cd to $updir_loc: $!\n" if $^W; next; } } @@ -944,7 +944,7 @@ sub _find_dir_symlnk($$$) { # Get the list of files in the current directory. unless (opendir DIR, ($no_chdir ? $dir_loc : $File::Find::current_dir)) { - warn "Can't opendir($dir_loc): $!\n"; + warn "Can't opendir($dir_loc): $!\n" if $^W; next; } @filenames = readdir DIR; @@ -989,7 +989,7 @@ sub _find_dir_symlnk($$$) { if ( $byd_flag < 0 ) { # must be finddepth, report dirname now unless ($no_chdir || ($dir_rel eq $File::Find::current_dir)) { unless (chdir $updir_loc) { # $updir_loc (parent dir) is always untainted - warn "Can't cd to $updir_loc: $!\n"; + warn "Can't cd to $updir_loc: $!\n" if $^W; next; } } |