aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/File/BackupCopy.pm1
-rw-r--r--t/02auto.t1
-rw-r--r--t/TestBackup.pm2
3 files changed, 3 insertions, 1 deletions
diff --git a/lib/File/BackupCopy.pm b/lib/File/BackupCopy.pm
index b762e03..226e8ce 100644
--- a/lib/File/BackupCopy.pm
+++ b/lib/File/BackupCopy.pm
@@ -159,2 +159,3 @@ sub backup_copy_internal {
}
+ $fh->unlink_on_destroy(0);
return $backup_name;
diff --git a/t/02auto.t b/t/02auto.t
index 0a01d84..61b24ed 100644
--- a/t/02auto.t
+++ b/t/02auto.t
@@ -32,2 +32,3 @@ fileok('a', $name);
ok(open(FH, '>', File::Spec->catfile('subdir','a.~1~')));
+close FH;
$name = backup_copy_auto('a', dir => 'subdir');
diff --git a/t/TestBackup.pm b/t/TestBackup.pm
index 0679776..72e5925 100644
--- a/t/TestBackup.pm
+++ b/t/TestBackup.pm
@@ -28,3 +28,3 @@ sub makefile {
$n = $size if $n > $size;
- syswrite(FH, join('',@pattern[0..$n])) or
+ syswrite(FH, join('',@pattern[0..$n-1])) or
croak "write error creating $file: $!";

Return to:

Send suggestions and report system problems to the System administrator.