mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-11 06:07:12 -06:00
Update to 7-Zip Version 21.02
This commit is contained in:
@@ -242,29 +242,25 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
|
||||
}
|
||||
|
||||
|
||||
static void DictSizeToString(UInt32 val, char *s)
|
||||
static char * DictSizeToString(UInt32 val, char *s)
|
||||
{
|
||||
for (unsigned i = 0; i <= 31; i++)
|
||||
if (((UInt32)1 << i) == val)
|
||||
{
|
||||
::ConvertUInt32ToString(i, s);
|
||||
return;
|
||||
}
|
||||
return ::ConvertUInt32ToString(i, s);
|
||||
char c = 'b';
|
||||
if ((val & ((1 << 20) - 1)) == 0) { val >>= 20; c = 'm'; }
|
||||
else if ((val & ((1 << 10) - 1)) == 0) { val >>= 10; c = 'k'; }
|
||||
::ConvertUInt32ToString(val, s);
|
||||
s += MyStringLen(s);
|
||||
s = ::ConvertUInt32ToString(val, s);
|
||||
*s++ = c;
|
||||
*s = 0;
|
||||
return s;
|
||||
}
|
||||
|
||||
static char *AddProp32(char *s, const char *name, UInt32 v)
|
||||
{
|
||||
*s++ = ':';
|
||||
s = MyStpCpy(s, name);
|
||||
::ConvertUInt32ToString(v, s);
|
||||
return s + MyStringLen(s);
|
||||
return ::ConvertUInt32ToString(v, s);
|
||||
}
|
||||
|
||||
void CHandler::GetMethod(NCOM::CPropVariant &prop)
|
||||
@@ -277,8 +273,7 @@ void CHandler::GetMethod(NCOM::CPropVariant &prop)
|
||||
if (_header.FilterID != 0)
|
||||
s = MyStpCpy(s, "BCJ ");
|
||||
s = MyStpCpy(s, "LZMA:");
|
||||
DictSizeToString(_header.GetDicSize(), s);
|
||||
s += strlen(s);
|
||||
s = DictSizeToString(_header.GetDicSize(), s);
|
||||
|
||||
UInt32 d = _header.GetProp();
|
||||
// if (d != 0x5D)
|
||||
@@ -315,10 +310,10 @@ API_FUNC_static_IsArc IsArc_Lzma(const Byte *p, size_t size)
|
||||
return k_IsArc_Res_NEED_MORE;
|
||||
if (p[0] >= 5 * 5 * 9)
|
||||
return k_IsArc_Res_NO;
|
||||
UInt64 unpackSize = GetUi64(p + 1 + 4);
|
||||
const UInt64 unpackSize = GetUi64(p + 1 + 4);
|
||||
if (unpackSize != (UInt64)(Int64)-1)
|
||||
{
|
||||
if (size >= ((UInt64)1 << 56))
|
||||
if (unpackSize >= ((UInt64)1 << 56))
|
||||
return k_IsArc_Res_NO;
|
||||
}
|
||||
if (unpackSize != 0)
|
||||
|
||||
Reference in New Issue
Block a user