From ef12c471a7ab4c1bcae1b7ebed0de9b5f7813e3d Mon Sep 17 00:00:00 2001 From: elasota Date: Wed, 25 Nov 2020 15:51:12 -0500 Subject: [PATCH] Fix missing directory entries for resource additions that have no existing directory (i.e. LICS) --- gpr2gpa/gpr2gpa.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gpr2gpa/gpr2gpa.cpp b/gpr2gpa/gpr2gpa.cpp index e55b5e5..32f2838 100644 --- a/gpr2gpa/gpr2gpa.cpp +++ b/gpr2gpa/gpr2gpa.cpp @@ -1353,6 +1353,33 @@ bool ApplyPatch(const std::vector &patchFileContents, std::vector::iterator it = archive.begin(), itEnd = archive.end(); it != itEnd; ++it) + { + if (it->m_name == dirName) + { + directoryEntry = &(*it); + break; + } + } + + if (!directoryEntry) + { + archive.push_back(PlannedEntry()); + directoryEntry = &archive.back(); + directoryEntry->m_name = dirName; + directoryEntry->m_isDirectory = true; + } + } + } + PlannedEntry *entry = nullptr; for (std::vector::iterator it = archive.begin(), itEnd = archive.end(); it != itEnd; ++it) {