Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2018-05-03 00:28:04 +0300
committerKornel <kornel@geekhood.net>2018-05-03 00:28:04 +0300
commit18dc2b41613055f0daf7f6a1d4311368798ea12a (patch)
tree866f6e6a50406fe822cb78f80728b7aebfd79786 /CPP/7zip/Archive/Zip
parentf19b649c73cd8b74c4e0b8a3a728a82c6bda47b4 (diff)
18.0518.05
Diffstat (limited to 'CPP/7zip/Archive/Zip')
-rw-r--r--CPP/7zip/Archive/Zip/ZipIn.cpp29
-rw-r--r--CPP/7zip/Archive/Zip/ZipIn.h2
2 files changed, 30 insertions, 1 deletions
diff --git a/CPP/7zip/Archive/Zip/ZipIn.cpp b/CPP/7zip/Archive/Zip/ZipIn.cpp
index 9e9918dc..aa7184af 100644
--- a/CPP/7zip/Archive/Zip/ZipIn.cpp
+++ b/CPP/7zip/Archive/Zip/ZipIn.cpp
@@ -1993,6 +1993,13 @@ HRESULT CVols::ParseArcName(IArchiveOpenVolumeCallback *volCallback)
}
else if (ext.IsEqualTo_Ascii_NoCase("exe"))
{
+ /* possible cases:
+ - exe with zip inside
+ - sfx: a.exe, a.z02, a.z03,... , a.zip
+ a.exe is start volume.
+ - zip renamed to exe
+ */
+
StartIsExe = true;
BaseName = name;
StartVolIndex = 0;
@@ -2000,7 +2007,22 @@ HRESULT CVols::ParseArcName(IArchiveOpenVolumeCallback *volCallback)
We can open arc.zip, if it was requesed to open arc.exe.
But it's possible that arc.exe and arc.zip are not parts of same archive.
So we can disable such operation */
- return S_FALSE; // don't open arc.zip instead of arc.exe
+
+ // 18.04: we still want to open zip renamed to exe.
+ /*
+ {
+ UString volName = name;
+ volName += IsUpperCase ? "Z01" : "z01";
+ {
+ CMyComPtr<IInStream> stream;
+ HRESULT res2 = volCallback->GetStream(volName, &stream);
+ if (res2 == S_OK)
+ DisableVolsSearch = true;
+ }
+ }
+ */
+ DisableVolsSearch = true;
+ return S_OK;
}
else if (ext[0] == 'z' || ext[0] == 'Z')
{
@@ -2040,6 +2062,9 @@ HRESULT CVols::ParseArcName(IArchiveOpenVolumeCallback *volCallback)
HRESULT CInArchive::ReadVols2(IArchiveOpenVolumeCallback *volCallback,
unsigned start, int lastDisk, int zipDisk, unsigned numMissingVolsMax, unsigned &numMissingVols)
{
+ if (Vols.DisableVolsSearch)
+ return S_OK;
+
numMissingVols = 0;
for (unsigned i = start;; i++)
@@ -2090,6 +2115,8 @@ HRESULT CInArchive::ReadVols2(IArchiveOpenVolumeCallback *volCallback,
}
if (res == S_FALSE || !stream)
{
+ if (i == 1 && Vols.StartIsExe)
+ return S_OK;
if (Vols.MissingName.IsEmpty())
Vols.MissingName = volName;
numMissingVols++;
diff --git a/CPP/7zip/Archive/Zip/ZipIn.h b/CPP/7zip/Archive/Zip/ZipIn.h
index e67bce42..88f29569 100644
--- a/CPP/7zip/Archive/Zip/ZipIn.h
+++ b/CPP/7zip/Archive/Zip/ZipIn.h
@@ -162,6 +162,7 @@ struct CVols
bool NeedSeek;
+ bool DisableVolsSearch;
bool StartIsExe; // is .exe
bool StartIsZ; // is .zip or .zNN
bool StartIsZip; // is .zip
@@ -201,6 +202,7 @@ struct CVols
StreamIndex = -1;
NeedSeek = false;
+ DisableVolsSearch = false;
StartIsExe = false;
StartIsZ = false;
StartIsZip = false;