From: Arvin Schnell Date: Fri, 8 Jan 2021 09:51:48 +0000 (+0100) Subject: - extend use of --root-prefix X-Git-Tag: v0.8.16~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F618%2Fhead;p=thirdparty%2Fsnapper.git - extend use of --root-prefix --- diff --git a/snapper/AppUtil.cc b/snapper/AppUtil.cc index 01e4fbcf..b78ff302 100644 --- a/snapper/AppUtil.cc +++ b/snapper/AppUtil.cc @@ -147,10 +147,12 @@ namespace snapper string prepend_root_prefix(const string& root_prefix, const string& path) { - if (root_prefix == "/") - return path; - else - return root_prefix + path; + if (root_prefix == "/") + return path; + else if (path == "/") + return root_prefix; + else + return root_prefix + path; } diff --git a/snapper/Lvm.cc b/snapper/Lvm.cc index cb829aac..f2e98abf 100644 --- a/snapper/Lvm.cc +++ b/snapper/Lvm.cc @@ -89,7 +89,7 @@ namespace snapper bool found = false; MtabData mtab_data; - if (!getMtabData(subvolume, found, mtab_data)) + if (!getMtabData(prepend_root_prefix(root_prefix, subvolume), found, mtab_data)) throw InvalidConfigException(); if (!found)