From: Jay Freeman (saurik) Date: Thu, 28 Jul 2016 04:39:23 +0000 (-0700) Subject: UnionFolder clobbered sub-paths in nested bundles. X-Git-Tag: v2.1.0~55 X-Git-Url: https://git.saurik.com/ldid.git/commitdiff_plain/35229d065ce164cc3d8a3b37446f27c9d85deddc UnionFolder clobbered sub-paths in nested bundles. --- diff --git a/ldid.cpp b/ldid.cpp index 14d1cef..4ac0012 100644 --- a/ldid.cpp +++ b/ldid.cpp @@ -1703,17 +1703,18 @@ bool UnionFolder::Open(const std::string &path, const Functor &)> &)> &code) { parent_.Find(path, fun([&](const std::string &name, const Functor &)> &save) { - if (files_.find(name) == files_.end()) + if (files_.find(path + name) == files_.end()) code(name, save); })); for (auto &file : files_) - code(file.first, fun([&](const Functor &code) { - parent_.Save(file.first, fun([&](std::streambuf &save) { - file.second.pubseekpos(0, std::ios::in); - code(file.second, save); + if (file.first.size() >= path.size() && file.first.substr(0, path.size()) == path) + code(file.first.substr(path.size()), fun([&](const Functor &code) { + parent_.Save(file.first, fun([&](std::streambuf &save) { + file.second.pubseekpos(0, std::ios::in); + code(file.second, save); + })); })); - })); } #ifndef LDID_NOTOOLS