summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-08-02 22:29:34 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-08-02 22:29:34 +0000
commita93b80c9f2cfbc274d7ad7ab7a53c560516968c5 (patch)
treee76f370cdb34ba5f44abb4eccf6dc21b98ef8c82 /lib
parent32f2ae54802153b346ebc78d2814988b5d22b26d (diff)
downloadperl-a93b80c9f2cfbc274d7ad7ab7a53c560516968c5.tar.gz
Be more careful about non-existent files.
p4raw-id: //depot/perl@11555
Diffstat (limited to 'lib')
-rw-r--r--lib/File/Copy.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm
index 0a6ea8bfef..861f65f00b 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)");
}
}