summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xborg-restore.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/borg-restore.pl b/borg-restore.pl
index 6f63de7..5f027a3 100755
--- a/borg-restore.pl
+++ b/borg-restore.pl
@@ -265,7 +265,6 @@ sub restore {
printf "Restoring %s to %s from archive %s\n", $path, $destination, $archive->{archive};
my $basename = basename($path);
- my $final_destination = abs_path($basename);
my $components_to_strip =()= $path =~ /\//g;
debug(sprintf("CWD is %s", getcwd()));
@@ -273,6 +272,7 @@ sub restore {
mkdir($destination) unless -d $destination;
chdir($destination) or die "Failed to chdir: $!";
+ my $final_destination = abs_path($basename);
$final_destination = untaint($final_destination, qr(.*));
debug("Removing ".$final_destination);
File::Path::remove_tree($final_destination);