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) {