btrbk: bugfix: fixed crash in action "diff"

pull/30/head
Axel Burri 2015-05-26 20:19:57 +02:00
parent eba0028fe4
commit f9f85b5cb0
2 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,7 @@ btrbk-current
source subvolume). source subvolume).
* Improved handling of command line subvolume filter for "run", * Improved handling of command line subvolume filter for "run",
"dryrun" and "tree" actions (closes: #21). "dryrun" and "tree" actions (closes: #21).
* Bugfix: fixed crash in action "diff".
btrbk-0.18.0 btrbk-0.18.0

6
btrbk
View File

@ -338,8 +338,10 @@ sub config_key($$)
my $key = shift || die; my $key = shift || die;
TRACE "config_key: context=$node->{CONTEXT}, key=$key"; TRACE "config_key: context=$node->{CONTEXT}, key=$key";
while(not exists($node->{$key})) { while(not exists($node->{$key})) {
# note: all config keys exist in root context (at least with default values) # note: while all config keys exist in root context (at least with default values),
$node = $node->{PARENT} || die; # we also allow fake configs (CONTEXT="cmdline") which have no PARENT.
return undef unless($node->{PARENT});
$node = $node->{PARENT};
} }
TRACE "config_key: found value=" . ($node->{$key} // "<undef>"); TRACE "config_key: found value=" . ($node->{$key} // "<undef>");
return $node->{$key}; return $node->{$key};