btrbk: tidy raw info file parsing

ionice
Axel Burri 2022-10-19 11:05:51 +02:00
parent d6910e43ea
commit 89c0aa31d7
1 changed files with 2 additions and 8 deletions

10
btrbk
View File

@ -2030,14 +2030,8 @@ sub system_read_raw_info_dir($)
push @raw_targets, $cur_target if($cur_target); push @raw_targets, $cur_target if($cur_target);
$cur_target = {}; $cur_target = {};
} }
next if /^#/; # ignore comments next unless($cur_target);
next if /^\s*$/; # ignore empty lines $cur_target->{$1} = $2 if /^([a-zA-Z_]+)=(.*)/;
if(/^([a-zA-Z_]+)=(.*)/) {
my ($key, $value) = ($1, $2);
if($cur_target) {
$cur_target->{$key} = $value;
}
}
} }
push @raw_targets, $cur_target if($cur_target); push @raw_targets, $cur_target if($cur_target);