Update to 7-Zip Version 18.05

This commit is contained in:
Tino Reichardt
2018-10-21 14:23:28 +02:00
parent 51dc99984a
commit 78fc3c9bc5
208 changed files with 13958 additions and 3588 deletions

View File

@@ -139,11 +139,10 @@ static unsigned ReadVarInt(const Byte *p, size_t maxSize, UInt64 *val)
{
*val = 0;
for (unsigned i = 0; i < maxSize;)
for (unsigned i = 0; i < maxSize && i < 10;)
{
Byte b = p[i];
if (i < 10)
*val |= (UInt64)(b & 0x7F) << (7 * i);
*val |= (UInt64)(b & 0x7F) << (7 * i);
i++;
if ((b & 0x80) == 0)
return i;
@@ -1086,7 +1085,7 @@ HRESULT CUnpacker::Create(DECL_EXTERNAL_CODECS_LOC_VARS const CItem &item, bool
if (!lzCoder)
{
const UInt32 methodID = 0x40305;
RINOK(CreateCoder(EXTERNAL_CODECS_LOC_VARS methodID, false, lzCoder));
RINOK(CreateCoder_Id(EXTERNAL_CODECS_LOC_VARS methodID, false, lzCoder));
if (!lzCoder)
return E_NOTIMPL;
}
@@ -1363,7 +1362,9 @@ static const Byte kProps[] =
kpidCharacts,
kpidSymLink,
kpidHardLink,
kpidCopyLink
kpidCopyLink,
kpidVolumeIndex
};
@@ -1794,6 +1795,18 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
case kpidSplitBefore: prop = item.IsSplitBefore(); break;
case kpidSplitAfter: prop = lastItem.IsSplitAfter(); break;
case kpidVolumeIndex:
{
if (item.VolIndex < _arcs.Size())
{
const CInArcInfo &arcInfo = _arcs[item.VolIndex].Info;
if (arcInfo.IsVolume())
prop = (UInt64)arcInfo.GetVolIndex();
}
break;
}
case kpidCRC:
{
const CItem *item2 = (lastItem.IsSplitAfter() ? &item : &lastItem);

View File

@@ -180,7 +180,7 @@ struct CItem
AString Name;
int VolIndex;
unsigned VolIndex;
int NextItem;
UInt32 UnixMTime;

View File

@@ -777,7 +777,9 @@ static const Byte kProps[] =
kpidCRC,
kpidHostOS,
kpidMethod,
kpidUnpackVer
kpidUnpackVer,
kpidVolumeIndex
};
static const Byte kArcProps[] =
@@ -995,6 +997,12 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
case kpidCommented: prop = item.IsCommented(); break;
case kpidSplitBefore: prop = item.IsSplitBefore(); break;
case kpidSplitAfter: prop = _items[refItem.ItemIndex + refItem.NumItems - 1].IsSplitAfter(); break;
case kpidVolumeIndex:
if (_arcInfo.Is_VolNumber_Defined())
prop = (UInt32)(_arcInfo.VolNumber + refItem.VolumeIndex);
break;
case kpidCRC:
{
prop = ((lastItem.IsSplitAfter()) ? item.FileCRC : lastItem.FileCRC);
@@ -1691,7 +1699,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
methodID += 2;
else
methodID += 3;
RINOK(CreateCoder(EXTERNAL_CODECS_VARS methodID, false, mi.Coder));
RINOK(CreateCoder_Id(EXTERNAL_CODECS_VARS methodID, false, mi.Coder));
}
if (mi.Coder == 0)

View File

@@ -26,7 +26,7 @@ struct CInArcInfo
UInt32 DataCRC;
bool EndOfArchive_was_Read;
CInArcInfo(): EndFlags(0), EndOfArchive_was_Read(false) {}
CInArcInfo(): EndFlags(0), EndOfArchive_was_Read(false), VolNumber(0) {}
UInt64 GetPhySize() const { return EndPos - StartPos; }