From 89c0aa31d759c1e9f82124d7a7a4cb99f8244602 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Wed, 19 Oct 2022 11:05:51 +0200 Subject: [PATCH] btrbk: tidy raw info file parsing --- btrbk | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/btrbk b/btrbk index e9380e6..38ca470 100755 --- a/btrbk +++ b/btrbk @@ -2030,14 +2030,8 @@ sub system_read_raw_info_dir($) push @raw_targets, $cur_target if($cur_target); $cur_target = {}; } - next if /^#/; # ignore comments - next if /^\s*$/; # ignore empty lines - if(/^([a-zA-Z_]+)=(.*)/) { - my ($key, $value) = ($1, $2); - if($cur_target) { - $cur_target->{$key} = $value; - } - } + next unless($cur_target); + $cur_target->{$1} = $2 if /^([a-zA-Z_]+)=(.*)/; } push @raw_targets, $cur_target if($cur_target);