Return-Path: X-Original-To: apmail-corinthia-commits-archive@minotaur.apache.org Delivered-To: apmail-corinthia-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4DEF0182B0 for ; Sun, 16 Aug 2015 17:14:45 +0000 (UTC) Received: (qmail 21198 invoked by uid 500); 16 Aug 2015 17:14:45 -0000 Delivered-To: apmail-corinthia-commits-archive@corinthia.apache.org Received: (qmail 21180 invoked by uid 500); 16 Aug 2015 17:14:45 -0000 Mailing-List: contact commits-help@corinthia.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@corinthia.incubator.apache.org Delivered-To: mailing list commits@corinthia.incubator.apache.org Received: (qmail 21171 invoked by uid 99); 16 Aug 2015 17:14:45 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Aug 2015 17:14:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id BC7F01AA2B3 for ; Sun, 16 Aug 2015 17:14:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.774 X-Spam-Level: * X-Spam-Status: No, score=1.774 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.006] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id BqFYF8wR0aiH for ; Sun, 16 Aug 2015 17:14:43 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 5EF7C20C0F for ; Sun, 16 Aug 2015 17:14:42 +0000 (UTC) Received: (qmail 21161 invoked by uid 99); 16 Aug 2015 17:14:40 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Aug 2015 17:14:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D810CDFE1D; Sun, 16 Aug 2015 17:14:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jani@apache.org To: commits@corinthia.incubator.apache.org Message-Id: <02d5c75e8e0746f8876d89df65f0cfa7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-corinthia git commit: Corrected microsoft word zip error Date: Sun, 16 Aug 2015 17:14:40 +0000 (UTC) Repository: incubator-corinthia Updated Branches: refs/heads/Release_0.1 d9694aec0 -> b98137626 Corrected microsoft word zip error Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/b9813762 Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/b9813762 Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/b9813762 Branch: refs/heads/Release_0.1 Commit: b9813762678723792d5601668ba0cb47002d58aa Parents: d9694ae Author: jani Authored: Sun Aug 16 19:14:21 2015 +0200 Committer: jani Committed: Sun Aug 16 19:14:21 2015 +0200 ---------------------------------------------------------------------- DocFormats/platform/src/Wrapper_zip.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/b9813762/DocFormats/platform/src/Wrapper_zip.c ---------------------------------------------------------------------- diff --git a/DocFormats/platform/src/Wrapper_zip.c b/DocFormats/platform/src/Wrapper_zip.c index 90f8d1e..3141a4a 100644 --- a/DocFormats/platform/src/Wrapper_zip.c +++ b/DocFormats/platform/src/Wrapper_zip.c @@ -179,7 +179,6 @@ static void releaseMemory(DFextZipHandleP zipHandle) { static void writeGlobalDirAndEndRecord(DFextZipHandleP zipHandle) { - static const char comment[] = "generated by Corinthia"; ZipDirectoryRecord dirRecord; ZipEndRecord endRecord; int i; @@ -188,17 +187,19 @@ static void writeGlobalDirAndEndRecord(DFextZipHandleP zipHandle) { // Prepare constant part of records endRecord.signature = ZipEndRecord_signature; endRecord.diskNumber = endRecord.centralDirectoryDiskNumber = endRecord.numEntriesThisDisk = 0; + endRecord.numEntriesThisDisk = endRecord.numEntries = zipHandle->zipFileCount; endRecord.centralDirectoryOffset = ftell(zipHandle->zipFile); - endRecord.zipCommentLength = strlen(comment); + endRecord.zipCommentLength = 0; dirRecord.signature = ZipDirectoryRecord_signature; - dirRecord.versionMadeBy = 0x2D; - dirRecord.versionNeededToExtract = 0x14; - dirRecord.lastModFileTime = dirRecord.lastModFileDate = - dirRecord.crc32 = dirRecord.extraFieldLength = dirRecord.fileCommentLength = - dirRecord.diskNumberStart = dirRecord.internalFileAttributes = 0; - dirRecord.generalPurposeBitFlag = 0x0006; + dirRecord.versionMadeBy = 0; + dirRecord.versionNeededToExtract = 20; + dirRecord.lastModFileDate = 32; + dirRecord.lastModFileTime = dirRecord.crc32 = dirRecord.extraFieldLength = + dirRecord.fileCommentLength = dirRecord.diskNumberStart = 0; + dirRecord.internalFileAttributes = 1; + dirRecord.generalPurposeBitFlag = 0x0000; dirRecord.externalFileAttributes = 0; // loop through all directory entries, write to disk while collecting size @@ -217,7 +218,6 @@ static void writeGlobalDirAndEndRecord(DFextZipHandleP zipHandle) { // and finally the end record fwrite(&endRecord, 1, sizeof(ZipEndRecord), zipHandle->zipFile); - fwrite(comment, 1, sizeof(comment), zipHandle->zipFile); } @@ -352,7 +352,7 @@ DFextZipDirEntryP DFextZipWriteFile(DFextZipHandleP zipHandle, const char *fileN // prepare to deflate strm.zalloc = Z_NULL; strm.zfree = strm.opaque = Z_NULL; - if (deflateInit2(&strm, Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) + if (deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) return NULL; // deflate buffer @@ -369,9 +369,10 @@ DFextZipDirEntryP DFextZipWriteFile(DFextZipHandleP zipHandle, const char *fileN entryPtr->compressedSize = strm.total_out; // prepare local header - header.versionNeededToExtract = 0x0014; - header.generalPurposeBitFlag = 0x0006; - header.lastModFileTime = header.lastModFileDate = header.extraFieldLength = header.crc32 = 0; + header.versionNeededToExtract = 20; + header.generalPurposeBitFlag = 0; + header.lastModFileDate = 32; + header.lastModFileTime = header.extraFieldLength = header.crc32 = 0; header.signature = ZipFileHeader_signature; header.compressionMethod = entryPtr->compressionMethod; header.compressedSize = entryPtr->compressedSize;