Manual integration error in #12235.
[p5sagit/p5-mst-13.2.git] / lib / File / Copy.pm
index 0a6ea8b..afb7635 100644 (file)
@@ -7,7 +7,7 @@
 
 package File::Copy;
 
-use 5.6.0;
+use 5.006;
 use strict;
 use warnings;
 use Carp;
@@ -24,7 +24,7 @@ sub mv;
 # package has not yet been updated to work with Perl 5.004, and so it
 # would be a Bad Thing for the CPAN module to grab it and replace this
 # module.  Therefore, we set this module's version higher than 2.0.
-$VERSION = '2.04';
+$VERSION = '2.05';
 
 require Exporter;
 @ISA = qw(Exporter);
@@ -72,10 +72,10 @@ sub copy {
 
     if ($Config{d_symlink} && $Config{d_readlink} &&
        !($^O eq 'Win32' || $^O eq 'os2' || $^O eq 'vms')) {
-       if (-l $from || -l $to) {
+       if ((-e $from && -l $from) || (-e $to && -l $to)) {
            my @fs = stat($from);
            my @ts = stat($to);
-           if ($fs[0] == $ts[0] && $fs[1] == $ts[1]) {
+           if (@fs && @ts && $fs[0] == $ts[0] && $fs[1] == $ts[1]) {
                croak("'$from' and '$to' are identical (not copied)");
            }
        }