mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-11 12:07:12 -06:00
Update to 7-Zip Version 22.00
See: https://sourceforge.net/p/sevenzip/discussion/45797/thread/9c2d9061ce/
This commit is contained in:
@@ -239,18 +239,18 @@ static HRESULT DecompressArchive(
|
||||
Sorted list for file paths was sorted with case insensitive compare function.
|
||||
But FindInSorted function did binary search via case sensitive compare function */
|
||||
|
||||
int Find_FileName_InSortedVector(const UStringVector &fileName, const UString &name);
|
||||
int Find_FileName_InSortedVector(const UStringVector &fileName, const UString &name)
|
||||
int Find_FileName_InSortedVector(const UStringVector &fileNames, const UString &name);
|
||||
int Find_FileName_InSortedVector(const UStringVector &fileNames, const UString &name)
|
||||
{
|
||||
unsigned left = 0, right = fileName.Size();
|
||||
unsigned left = 0, right = fileNames.Size();
|
||||
while (left != right)
|
||||
{
|
||||
unsigned mid = (left + right) / 2;
|
||||
const UString &midValue = fileName[mid];
|
||||
int compare = CompareFileNames(name, midValue);
|
||||
if (compare == 0)
|
||||
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
|
||||
const UString &midVal = fileNames[mid];
|
||||
const int comp = CompareFileNames(name, midVal);
|
||||
if (comp == 0)
|
||||
return (int)mid;
|
||||
if (compare < 0)
|
||||
if (comp < 0)
|
||||
right = mid;
|
||||
else
|
||||
left = mid + 1;
|
||||
@@ -314,8 +314,13 @@ HRESULT Extract(
|
||||
|
||||
CArchiveExtractCallback *ecs = new CArchiveExtractCallback;
|
||||
CMyComPtr<IArchiveExtractCallback> ec(ecs);
|
||||
bool multi = (numArcs > 1);
|
||||
ecs->InitForMulti(multi, options.PathMode, options.OverwriteMode,
|
||||
|
||||
const bool multi = (numArcs > 1);
|
||||
|
||||
ecs->InitForMulti(multi,
|
||||
options.PathMode,
|
||||
options.OverwriteMode,
|
||||
options.ZoneMode,
|
||||
false // keepEmptyDirParts
|
||||
);
|
||||
#ifndef _SFX
|
||||
@@ -335,12 +340,18 @@ HRESULT Extract(
|
||||
if (skipArcs[i])
|
||||
continue;
|
||||
|
||||
ecs->InitBeforeNewArchive();
|
||||
|
||||
const UString &arcPath = arcPaths[i];
|
||||
NFind::CFileInfo fi;
|
||||
if (options.StdInMode)
|
||||
{
|
||||
fi.Size = 0;
|
||||
fi.Attrib = 0;
|
||||
// do we need ctime and mtime?
|
||||
fi.ClearBase();
|
||||
fi.Size = 0; // (UInt64)(Int64)-1;
|
||||
fi.SetAsFile();
|
||||
// NTime::GetCurUtc_FiTime(fi.MTime);
|
||||
// fi.CTime = fi.ATime = fi.MTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -417,6 +428,15 @@ HRESULT Extract(
|
||||
continue;
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(_SFX)
|
||||
if (options.ZoneMode != NExtract::NZoneIdMode::kNone
|
||||
&& !options.StdInMode)
|
||||
{
|
||||
ReadZoneFile_Of_BaseFile(us2fs(arcPath), ecs->ZoneBuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (arcLink.Arcs.Size() != 0)
|
||||
{
|
||||
if (arcLink.GetArc()->IsHashHandler(op))
|
||||
@@ -490,11 +510,16 @@ HRESULT Extract(
|
||||
*/
|
||||
|
||||
CArc &arc = arcLink.Arcs.Back();
|
||||
arc.MTimeDefined = (!options.StdInMode && !fi.IsDevice);
|
||||
arc.MTime = fi.MTime;
|
||||
arc.MTime.Def = !options.StdInMode
|
||||
#ifdef _WIN32
|
||||
&& !fi.IsDevice
|
||||
#endif
|
||||
;
|
||||
if (arc.MTime.Def)
|
||||
arc.MTime.Set_From_FiTime(fi.MTime);
|
||||
|
||||
UInt64 packProcessed;
|
||||
bool calcCrc =
|
||||
const bool calcCrc =
|
||||
#ifndef _SFX
|
||||
(hash != NULL);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user