From: Jarkko Hietaniemi Date: Thu, 2 Aug 2001 22:29:34 +0000 (+0000) Subject: Be more careful about non-existent files. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a93b80c9f2cfbc274d7ad7ab7a53c560516968c5;p=p5sagit%2Fp5-mst-13.2.git Be more careful about non-existent files. p4raw-id: //depot/perl@11555 --- diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index 0a6ea8b..861f65f 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -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)"); } }