]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- added function to prepend root-prefix
authorArvin Schnell <aschnell@suse.de>
Mon, 16 Feb 2015 10:44:45 +0000 (11:44 +0100)
committerArvin Schnell <aschnell@suse.de>
Mon, 16 Feb 2015 10:44:45 +0000 (11:44 +0100)
snapper/AppUtil.cc
snapper/AppUtil.h

index ed76005e264e710439573f4d5ea9b949de0c5a2f..9eb17d33ab20ca5fd663dcbb2dd3c16b0470c8ad 100644 (file)
@@ -142,6 +142,16 @@ namespace snapper
     }
 
 
+    string
+    prepend_root_prefix(const string& root_prefix, const string& path)
+    {
+        if (root_prefix == "/")
+            return path;
+        else
+            return root_prefix + path;
+    }
+
+
     string
     dirname(const string& name)
     {
index 1b0b0d828c104db626c79ff56873115a770d8a78..c735a9df3c6273203a54abdd995066e486e69013 100644 (file)
@@ -57,6 +57,8 @@ namespace snapper
 
     string realpath(const string& path);
 
+    string prepend_root_prefix(const string& root_prefix, const string& path);
+
     string stringerror(int errnum);
 
     string dirname(const string& name);