summaryrefslogtreecommitdiffstats
path: root/twrpDU.cpp
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2014-03-31 22:58:40 +0200
committerGerrit Code Review <gerrit2@gerrit>2014-04-15 15:28:45 +0200
commit50248ab86b63e76a1a341f170676c59c4e5fb166 (patch)
treedb541a7c6b7eaff4edbc4add0a38bdfbbf9ceb12 /twrpDU.cpp
parentEnable rk30xx hack (diff)
downloadandroid_bootable_recovery-50248ab86b63e76a1a341f170676c59c4e5fb166.tar
android_bootable_recovery-50248ab86b63e76a1a341f170676c59c4e5fb166.tar.gz
android_bootable_recovery-50248ab86b63e76a1a341f170676c59c4e5fb166.tar.bz2
android_bootable_recovery-50248ab86b63e76a1a341f170676c59c4e5fb166.tar.lz
android_bootable_recovery-50248ab86b63e76a1a341f170676c59c4e5fb166.tar.xz
android_bootable_recovery-50248ab86b63e76a1a341f170676c59c4e5fb166.tar.zst
android_bootable_recovery-50248ab86b63e76a1a341f170676c59c4e5fb166.zip
Diffstat (limited to 'twrpDU.cpp')
-rw-r--r--twrpDU.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/twrpDU.cpp b/twrpDU.cpp
index 38eb4e02a..28c3dfa15 100644
--- a/twrpDU.cpp
+++ b/twrpDU.cpp
@@ -41,7 +41,6 @@ twrpDU::twrpDU() {
#ifdef RECOVERY_SDCARD_ON_DATA
add_absolute_dir("/data/media");
#endif
- parent = "";
}
void twrpDU::add_relative_dir(const string& dir) {
@@ -80,7 +79,7 @@ uint64_t twrpDU::Get_Folder_Size(const string& Path) {
}
while ((de = readdir(d)) != NULL) {
- if (de->d_type == DT_DIR && !check_skip_dirs(Path, de->d_name)) {
+ if (de->d_type == DT_DIR && !check_skip_dirs(Path + "/" + de->d_name)) {
dusize += Get_Folder_Size(Path + "/" + de->d_name);
} else if (de->d_type == DT_REG) {
stat((Path + "/" + de->d_name).c_str(), &st);
@@ -96,12 +95,7 @@ bool twrpDU::check_relative_skip_dirs(const string& dir) {
}
bool twrpDU::check_absolute_skip_dirs(const string& path) {
- string normalized = TWFunc::Remove_Trailing_Slashes(path);
- return std::find(absolutedir.begin(), absolutedir.end(), normalized) != absolutedir.end();
-}
-
-bool twrpDU::check_skip_dirs(const string& parent, const string& dir) {
- return check_relative_skip_dirs(dir) || check_absolute_skip_dirs(parent + "/" + dir);
+ return std::find(absolutedir.begin(), absolutedir.end(), path) != absolutedir.end();
}
bool twrpDU::check_skip_dirs(const string& path) {