diff options
Diffstat (limited to 'tools/aapt2/ZipEntry.cpp')
-rw-r--r-- | tools/aapt2/ZipEntry.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/aapt2/ZipEntry.cpp b/tools/aapt2/ZipEntry.cpp index ad5d84a..891b4e1 100644 --- a/tools/aapt2/ZipEntry.cpp +++ b/tools/aapt2/ZipEntry.cpp @@ -144,9 +144,15 @@ void ZipEntry::initNew(const char* fileName, const char* comment) * Initializes the CDE and the LFH. */ status_t ZipEntry::initFromExternal(const ZipFile* /* pZipFile */, - const ZipEntry* pEntry) + const ZipEntry* pEntry, const char* storageName) { mCDE = pEntry->mCDE; + if (storageName && *storageName != 0) { + mCDE.mFileNameLength = strlen(storageName); + mCDE.mFileName = new unsigned char[mCDE.mFileNameLength + 1]; + strcpy((char*) mCDE.mFileName, storageName); + } + // Check whether we got all the memory needed. if ((mCDE.mFileNameLength > 0 && mCDE.mFileName == NULL) || (mCDE.mFileCommentLength > 0 && mCDE.mFileComment == NULL) || |