Fix lpdump issue with relatives img paths
author3arthur6 <arthur.trouillot@gmail.com>
Sun, 14 Nov 2021 22:21:35 +0000 (23:21 +0100)
committer3arthur6 <arthur.trouillot@gmail.com>
Sun, 14 Nov 2021 22:21:35 +0000 (23:21 +0100)
partition_tools/lpdump.cc

index 047b5ee..450649e 100755 (executable)
@@ -29,6 +29,7 @@
 #include <regex>
 #include <string>
 #include <vector>
+#include <filesystem>
 
 #include <android-base/parseint.h>
 #include <android-base/properties.h>
@@ -384,7 +385,7 @@ static std::unique_ptr<LpMetadata> ReadDeviceOrFile(const std::string& path, uin
     if (IsEmptySuperImage(path)) {
         return ReadFromImageFile(path);
     }
-    return ReadMetadata(path, slot);
+    return ReadMetadata(std::filesystem::absolute(path), slot);
 }
 
 int LpdumpMain(int argc, char* argv[], std::ostream& cout, std::ostream& cerr) {