From 35229d065ce164cc3d8a3b37446f27c9d85deddc Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 27 Jul 2016 21:39:23 -0700 Subject: UnionFolder clobbered sub-paths in nested bundles. --- ldid.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ldid.cpp') 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 -- cgit v1.2.3-56-ge451