summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/File/Copy.pm10
-rw-r--r--lib/File/Copy.t1
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm
index cb246d645f..b5ca436618 100644
--- a/lib/File/Copy.pm
+++ b/lib/File/Copy.pm
@@ -22,7 +22,7 @@ sub syscopy;
sub cp;
sub mv;
-$VERSION = '2.23';
+$VERSION = '2.24';
require Exporter;
@ISA = qw(Exporter);
@@ -133,6 +133,10 @@ sub copy {
return 1;
}
+ if (!$from_a_handle && !$to_a_handle && -d $to && ! -d $from) {
+ $to = _catname($from, $to);
+ }
+
if ((($Config{d_symlink} && $Config{d_readlink}) || $Config{d_link}) &&
!($^O eq 'MSWin32' || $^O eq 'os2')) {
my @fs = stat($from);
@@ -145,10 +149,6 @@ sub copy {
}
}
- if (!$from_a_handle && !$to_a_handle && -d $to && ! -d $from) {
- $to = _catname($from, $to);
- }
-
if (defined &syscopy && !$Syscopy_is_copy
&& !$to_a_handle
&& !($from_a_handle && $^O eq 'os2' ) # OS/2 cannot handle handles
diff --git a/lib/File/Copy.t b/lib/File/Copy.t
index 7975cfecbd..e46de358f6 100644
--- a/lib/File/Copy.t
+++ b/lib/File/Copy.t
@@ -476,7 +476,6 @@ use File::Temp qw(tempdir);
use File::Spec;
SKIP: {
- local $TODO = "copy foo/file to foo/ overwrites, RT #111126";
# RT #111126: File::Copy copy() zeros file when copying a file
# into the same directory it is stored in