From d547adcfe40eacb4f43773a0be175e56f225b3fd Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 27 Nov 2010 16:57:07 +0100 Subject: restore.pl: ignore invalid selections Signed-off-by: Florian Pritz --- restore.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'restore.pl') diff --git a/restore.pl b/restore.pl index 5e7214c..d553f06 100755 --- a/restore.pl +++ b/restore.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl #---------------------------------------------------- -# Version: 0.1.0 +# Version: 0.1.1 # Author: Florian "Bluewind" Pritz # # Licensed under WTFPL v2 @@ -69,7 +69,7 @@ for my $filename (@ARGV) { print "\e[0;34mEnter ID to restore (Enter to skip): \e[0m"; my $id = ; chomp $id; - next unless ($id =~ /^\d+$/); + next unless (exists ($filelist[$id])); remove_tree $file if -d $file; # need mtime preservation #rcopy $filelist[$id]->{path}, $file; -- cgit v1.2.3-24-g4f1b