From cf70f4fd4f720f98c1fd2e8dfc3fbe77e94068f8 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 4 Dec 2019 16:25:45 -0800 Subject: [PATCH] Ignore the timestamp, add TODO --- SabreTools.Library/External/Compress/ZipFile/zipFile.cs | 2 +- SabreTools.Library/FileTypes/ZipArchive.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/SabreTools.Library/External/Compress/ZipFile/zipFile.cs b/SabreTools.Library/External/Compress/ZipFile/zipFile.cs index 6bcbe891..1d7c80d7 100644 --- a/SabreTools.Library/External/Compress/ZipFile/zipFile.cs +++ b/SabreTools.Library/External/Compress/ZipFile/zipFile.cs @@ -528,7 +528,7 @@ namespace Compress.ZipFile - + // TODO: Figure out the timestamp instead of using ticks like we were before public ZipReturn ZipFileOpen(string newFilename, long timestamp, bool readHeaders) { ZipFileClose(); diff --git a/SabreTools.Library/FileTypes/ZipArchive.cs b/SabreTools.Library/FileTypes/ZipArchive.cs index 3e042250..5d7d3b96 100644 --- a/SabreTools.Library/FileTypes/ZipArchive.cs +++ b/SabreTools.Library/FileTypes/ZipArchive.cs @@ -71,7 +71,7 @@ namespace SabreTools.Library.FileTypes // Extract all files to the temp directory ZipFile zf = new ZipFile(); - ZipReturn zr = zf.ZipFileOpen(this.Filename, new FileInfo(this.Filename).LastWriteTime.Ticks, true); + ZipReturn zr = zf.ZipFileOpen(this.Filename, -1, true); if (zr != ZipReturn.ZipGood) { throw new Exception(ZipFile.ZipErrorMessageText(zr)); @@ -203,7 +203,7 @@ namespace SabreTools.Library.FileTypes try { ZipFile zf = new ZipFile(); - ZipReturn zr = zf.ZipFileOpen(this.Filename, new FileInfo(this.Filename).LastWriteTime.Ticks, true); + ZipReturn zr = zf.ZipFileOpen(this.Filename, -1, true); if (zr != ZipReturn.ZipGood) { throw new Exception(ZipFile.ZipErrorMessageText(zr)); @@ -278,7 +278,7 @@ namespace SabreTools.Library.FileTypes try { ZipFile zf = new ZipFile(); - ZipReturn zr = zf.ZipFileOpen(this.Filename, new FileInfo(this.Filename).LastWriteTime.Ticks, true); + ZipReturn zr = zf.ZipFileOpen(this.Filename, -1, true); if (zr != ZipReturn.ZipGood) { throw new Exception(ZipFile.ZipErrorMessageText(zr)); @@ -293,6 +293,7 @@ namespace SabreTools.Library.FileTypes if (zr != ZipReturn.ZipGood) { Globals.Logger.Warning("An error occurred while reading archive {0}: Zip Error - {1}", this.Filename, zr); + zr = zf.ZipFileCloseReadStream(); continue; } @@ -301,6 +302,7 @@ namespace SabreTools.Library.FileTypes || zf.Filename(i).EndsWith(Path.AltDirectorySeparatorChar.ToString()) || zf.Filename(i).EndsWith(Path.PathSeparator.ToString())) { + zr = zf.ZipFileCloseReadStream(); continue; }