diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2016-07-27 21:39:23 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2016-07-27 22:00:47 -0700 |
commit | 35229d065ce164cc3d8a3b37446f27c9d85deddc (patch) | |
tree | 256ea97ddf9d9b5f145e87f11c1daf282bc871a4 /ldid.cpp | |
parent | e4d33eecb0efe964cd83637ab57f25122b13d1e5 (diff) | |
download | ldid-35229d065ce164cc3d8a3b37446f27c9d85deddc.tar.gz ldid-35229d065ce164cc3d8a3b37446f27c9d85deddc.tar.zst ldid-35229d065ce164cc3d8a3b37446f27c9d85deddc.zip |
UnionFolder clobbered sub-paths in nested bundles.
Diffstat (limited to 'ldid.cpp')
-rw-r--r-- | ldid.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1703,17 +1703,18 @@ bool UnionFolder::Open(const std::string &path, const Functor<void (std::streamb void UnionFolder::Find(const std::string &path, const Functor<void (const std::string &, const Functor<void (const Functor<void (std::streambuf &, std::streambuf &)> &)> &)> &code) { parent_.Find(path, fun([&](const std::string &name, const Functor<void (const Functor<void (std::streambuf &, std::streambuf &)> &)> &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<void (std::streambuf &, std::streambuf &)> &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<void (std::streambuf &, std::streambuf &)> &code) { + parent_.Save(file.first, fun([&](std::streambuf &save) { + file.second.pubseekpos(0, std::ios::in); + code(file.second, save); + })); })); - })); } #ifndef LDID_NOTOOLS |