From: Joey Hess Date: Tue, 16 Oct 2007 05:41:03 +0000 (-0400) Subject: * Fix a bug in inheritance of default settings in chained .mrconfig files. X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/f545405cbfefec20d0d8e2ad77bd1e4203c53932?hp=d9b82cdd522cbd05dbffa5b72037415407bc46f6 * Fix a bug in inheritance of default settings in chained .mrconfig files. --- diff --git a/debian/changelog b/debian/changelog index a6e1e9b..ea49785 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ mr (0.2) UNRELEASED; urgency=low * Fix line number display for config file parse errors. + * Fix a bug in inheritance of default settings in chained .mrconfig files. - -- Joey Hess Sun, 14 Oct 2007 19:03:22 -0400 + -- Joey Hess Tue, 16 Oct 2007 01:40:32 -0400 mr (0.1) unstable; urgency=low diff --git a/mr b/mr index e29e367..adc0546 100755 --- a/mr +++ b/mr @@ -518,7 +518,10 @@ sub loadconfig { #{{{ # copy in defaults from first parent my $parent=$dir; - while ($parent=~s/^(.*)\/[^\/]+\/?$/$1/) { + while ($parent=~s/^(.*\/)[^\/]+\/?$/$1/) { + if ($parent eq '/') { + $parent=""; + } if (exists $config{$parent} && exists $config{$parent}{DEFAULT}) { $config{$dir}{DEFAULT}={ %{$config{$parent}{DEFAULT}} };