Clear the relative directory before passing on to twrpTar with the static du object. Otherwise we will not backup /system/media etc
Change-Id: Ib62af6ad8596aa18bf48cb750e2ecf442dadc627
diff --git a/twrpDU.cpp b/twrpDU.cpp
index 66c8031..c4446d4 100644
--- a/twrpDU.cpp
+++ b/twrpDU.cpp
@@ -43,6 +43,16 @@
relativedir.push_back(dir);
}
+void twrpDU::clear_relative_dir(string dir) {
+ vector<string>::iterator iter = relativedir.begin();
+ while (iter != relativedir.end()) {
+ if (*iter == dir)
+ iter = relativedir.erase(iter);
+ else
+ iter++;
+ }
+}
+
void twrpDU::add_absolute_dir(string dir) {
absolutedir.push_back(dir);
}
@@ -97,7 +107,6 @@
}
}
for (int i = 0; i < absolutedir.size(); ++i) {
- //string absdir = parent + dir;
if (dir == absolutedir.at(i)) {
result = true;
break;