This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32f2ae5
)
Be more careful about non-existent files.
author
Jarkko Hietaniemi
<jhi@iki.fi>
Thu, 2 Aug 2001 22:29:34 +0000
(22:29 +0000)
committer
Jarkko Hietaniemi
<jhi@iki.fi>
Thu, 2 Aug 2001 22:29:34 +0000
(22:29 +0000)
p4raw-id: //depot/perl@11555
lib/File/Copy.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/File/Copy.pm
b/lib/File/Copy.pm
index
0a6ea8b
..
861f65f
100644
(file)
--- 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)");
}
}