Skip to content

Commit

Permalink
15.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Pavlov authored and kornelski committed May 27, 2016
1 parent 5de23c1 commit 9608215
Show file tree
Hide file tree
Showing 73 changed files with 1,849 additions and 778 deletions.
8 changes: 4 additions & 4 deletions C/7zVersion.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define MY_VER_MAJOR 15
#define MY_VER_MINOR 12
#define MY_VER_MINOR 13
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "15.12"
#define MY_VERSION "15.12"
#define MY_DATE "2015-11-19"
#define MY_VERSION_NUMBERS "15.13"
#define MY_VERSION "15.13"
#define MY_DATE "2015-12-31"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
Expand Down
4 changes: 3 additions & 1 deletion C/CpuArch.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* CpuArch.h -- CPU specific code
2015-10-31: Igor Pavlov : Public domain */
2015-12-01: Igor Pavlov : Public domain */

#ifndef __CPU_ARCH_H
#define __CPU_ARCH_H
Expand Down Expand Up @@ -78,7 +78,9 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
|| defined(__MIPSEB) \
|| defined(_MIPSEB) \
|| defined(__m68k__) \
|| defined(__s390__) \
|| defined(__s390x__) \
|| defined(__zarch__) \
|| (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
#define MY_CPU_BE
#endif
Expand Down
7 changes: 5 additions & 2 deletions C/Util/7zipInstall/7zipInstall.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* 7zipInstall.c - 7-Zip Installer
2015-11-08 : Igor Pavlov : Public domain */
2015-12-09 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -571,6 +571,8 @@ static INT_PTR CALLBACK MyDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
#endif
break;
}

default: return FALSE;
}
break;

Expand Down Expand Up @@ -1011,7 +1013,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
BOOL bRet;
MSG msg;

while ((bRet = GetMessage(&msg, g_HWND, 0, 0)) != 0)
// we need messages for all thread windows (including EDITTEXT window in dialog)
while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0)
{
if (bRet == -1)
return retCode;
Expand Down
10 changes: 6 additions & 4 deletions C/Util/7zipUninstall/7zipUninstall.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* 7zipUninstall.c - 7-Zip Uninstaller
2015-11-08 : Igor Pavlov : Public domain */
2015-12-26 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -542,7 +542,7 @@ static BOOL RemoveDir()
#define k_Lang L"Lang"

// NUM_LANG_TXT_FILES files are placed before en.ttt
#define NUM_LANG_TXT_FILES 86
#define NUM_LANG_TXT_FILES 87

#ifdef _64BIT_INSTALLER
#define NUM_EXTRA_FILES_64BIT 1
Expand All @@ -556,7 +556,7 @@ static const char *k_Names =
"af an ar ast az ba be bg bn br ca co cs cy da de el eo es et eu ext"
" fa fi fr fur fy ga gl gu he hi hr hu hy id io is it ja ka kaa kk ko ku ku-ckb ky"
" lij lt lv mk mn mng mng2 mr ms nb ne nl nn pa-in pl ps pt pt-br ro ru"
" sa si sk sl sq sr-spc sr-spl sv ta th tr tt ug uk uz va vi zh-cn zh-tw"
" sa si sk sl sq sr-spc sr-spl sv ta th tr tt ug uk uz va vi yo zh-cn zh-tw"
" en.ttt"
" descript.ion"
" History.txt"
Expand Down Expand Up @@ -771,6 +771,8 @@ static INT_PTR CALLBACK MyDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
OnClose();
break;
}

default: return FALSE;
}
break;

Expand Down Expand Up @@ -1033,7 +1035,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
BOOL bRet;
MSG msg;

while ((bRet = GetMessage(&msg, g_HWND, 0, 0)) != 0)
while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0)
{
if (bRet == -1)
return retCode;
Expand Down
11 changes: 7 additions & 4 deletions CPP/7zip/Archive/7z/7zUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,14 +567,17 @@ static const char *g_Exts =
" iso bin nrg mdf img pdi tar cpio xpi"
" vfd vhd vud vmc vsv"
" vmdk dsk nvram vmem vmsd vmsn vmss vmtm"
" inl inc idl acf asa h hpp hxx c cpp cxx rc java cs pas bas vb cls ctl frm dlg def"
" inl inc idl acf asa"
" h hpp hxx c cpp cxx m mm go swift"
" rc java cs rs pas bas vb cls ctl frm dlg def"
" f77 f f90 f95"
" asm sql manifest dep"
" asm s"
" sql manifest dep"
" mak clw csproj vcproj sln dsp dsw"
" class"
" bat cmd"
" bat cmd bash sh"
" xml xsd xsl xslt hxk hxc htm html xhtml xht mht mhtml htw asp aspx css cgi jsp shtml"
" awk sed hta js php php3 php4 php5 phptml pl pm py pyo rb sh tcl vbs"
" awk sed hta js json php php3 php4 php5 phptml pl pm py pyo rb tcl ts vbs"
" text txt tex ans asc srt reg ini doc docx mcw dot rtf hlp xls xlr xlt xlw ppt pdf"
" sxc sxd sxi sxg sxw stc sti stw stm odt ott odg otg odp otp ods ots odf"
" abw afp cwk lwp wpd wps wpt wrf wri"
Expand Down
16 changes: 10 additions & 6 deletions CPP/7zip/Archive/Cab/CabHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ HRESULT CFolderOutStream::Write2(const void *data, UInt32 size, UInt32 *processe
realProcessed += size;
if (processedSize)
*processedSize = realProcessed;
m_PosInFolder += size;
return S_OK;
// return E_FAIL;
}
Expand Down Expand Up @@ -843,7 +844,7 @@ HRESULT CFolderOutStream::FlushCorrupted(unsigned folderIndex)
return S_OK;
}

const unsigned kBufSize = (1 << 10);
const unsigned kBufSize = (1 << 12);
Byte buf[kBufSize];
for (unsigned i = 0; i < kBufSize; i++)
buf[i] = 0;
Expand Down Expand Up @@ -937,8 +938,15 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,

CRecordVector<bool> extractStatuses;

for (i = 0; i < numItems;)
for (i = 0;;)
{
lps->OutSize = totalUnPacked;
lps->InSize = totalPacked;
RINOK(lps->SetCur());

if (i >= numItems)
break;

unsigned index = allFilesMode ? i : indices[i];

const CMvItem &mvItem = m_Database.Items[index];
Expand Down Expand Up @@ -1003,10 +1011,6 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
curUnpack = item.GetEndOffset();
}

lps->OutSize = totalUnPacked;
lps->InSize = totalPacked;
RINOK(lps->SetCur());

CFolderOutStream *cabFolderOutStream = new CFolderOutStream;
CMyComPtr<ISequentialOutStream> outStream(cabFolderOutStream);

Expand Down
22 changes: 21 additions & 1 deletion CPP/7zip/Archive/Cab/CabIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ void CInArchive::ReadOtherArc(COtherArc &oa)
ReadName(oa.DiskName);
}


struct CSignatureFinder
{
Byte *Buf;
Expand Down Expand Up @@ -100,6 +101,7 @@ struct CSignatureFinder
HRESULT Find();
};


HRESULT CSignatureFinder::Find()
{
for (;;)
Expand Down Expand Up @@ -156,6 +158,7 @@ HRESULT CSignatureFinder::Find()
}
}


bool CInArcInfo::Parse(const Byte *p)
{
if (Get32(p + 0x0C) != 0 ||
Expand All @@ -177,6 +180,7 @@ bool CInArcInfo::Parse(const Byte *p)
return true;
}


HRESULT CInArchive::Open2(CDatabaseEx &db, const UInt64 *searchHeaderSizeLimit)
{
IsArc = false;
Expand Down Expand Up @@ -286,7 +290,9 @@ HRESULT CInArchive::Open2(CDatabaseEx &db, const UInt64 *searchHeaderSizeLimit)
if (ai.IsThereNext()) ReadOtherArc(ai.NextArc);

UInt32 i;

db.Folders.ClearAndReserve(ai.NumFolders);

for (i = 0; i < ai.NumFolders; i++)
{
Read(p, 8);
Expand All @@ -311,6 +317,7 @@ HRESULT CInArchive::Open2(CDatabaseEx &db, const UInt64 *searchHeaderSizeLimit)
}

db.Items.ClearAndReserve(ai.NumFiles);

for (i = 0; i < ai.NumFiles; i++)
{
Read(p, 16);
Expand All @@ -324,6 +331,7 @@ HRESULT CInArchive::Open2(CDatabaseEx &db, const UInt64 *searchHeaderSizeLimit)
item.Attributes = Get16(p + 14);

ReadName(item.Name);

if (item.GetFolderIndex(db.Folders.Size()) >= (int)db.Folders.Size())
{
HeaderError = true;
Expand All @@ -336,6 +344,7 @@ HRESULT CInArchive::Open2(CDatabaseEx &db, const UInt64 *searchHeaderSizeLimit)
return S_OK;
}


HRESULT CInArchive::Open(CDatabaseEx &db, const UInt64 *searchHeaderSizeLimit)
{
try
Expand Down Expand Up @@ -370,6 +379,7 @@ static int CompareMvItems(const CMvItem *p1, const CMvItem *p2, void *param)
return MyCompare(p1->ItemIndex, p2->ItemIndex);
}


bool CMvDatabaseEx::AreItemsEqual(unsigned i1, unsigned i2)
{
const CMvItem *p1 = &Items[i1];
Expand All @@ -384,12 +394,15 @@ bool CMvDatabaseEx::AreItemsEqual(unsigned i1, unsigned i2)
&& item1.Name == item2.Name;
}


void CMvDatabaseEx::FillSortAndShrink()
{
Items.Clear();
StartFolderOfVol.Clear();
FolderStartFileIndex.Clear();

int offset = 0;

FOR_VECTOR (v, Volumes)
{
const CDatabaseEx &db = Volumes[v];
Expand Down Expand Up @@ -422,11 +435,12 @@ void CMvDatabaseEx::FillSortAndShrink()
FOR_VECTOR (i, Items)
{
int folderIndex = GetFolderIndex(&Items[i]);
if (folderIndex >= (int)FolderStartFileIndex.Size())
while (folderIndex >= (int)FolderStartFileIndex.Size())
FolderStartFileIndex.Add(i);
}
}


bool CMvDatabaseEx::Check()
{
for (unsigned v = 1; v < Volumes.Size(); v++)
Expand All @@ -444,9 +458,11 @@ bool CMvDatabaseEx::Check()
return false;
}
}

UInt32 beginPos = 0;
UInt64 endPos = 0;
int prevFolder = -2;

FOR_VECTOR (i, Items)
{
const CMvItem &mvItem = Items[i];
Expand All @@ -456,15 +472,19 @@ bool CMvDatabaseEx::Check()
const CItem &item = Volumes[mvItem.VolumeIndex].Items[mvItem.ItemIndex];
if (item.IsDir())
continue;

int folderIndex = GetFolderIndex(&mvItem);

if (folderIndex != prevFolder)
prevFolder = folderIndex;
else if (item.Offset < endPos &&
(item.Offset != beginPos || item.GetEndOffset() != endPos))
return false;

beginPos = item.Offset;
endPos = item.GetEndOffset();
}

return true;
}

Expand Down
5 changes: 5 additions & 0 deletions CPP/7zip/Archive/Cab/CabIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct COtherArc
}
};


struct CArchInfo
{
Byte VersionMinor; // cabinet file format version, minor
Expand Down Expand Up @@ -65,6 +66,7 @@ struct CArchInfo
}
};


struct CInArcInfo: public CArchInfo
{
UInt32 Size; // size of this cabinet file in bytes
Expand Down Expand Up @@ -105,17 +107,20 @@ struct CDatabase
}
};


struct CDatabaseEx: public CDatabase
{
CMyComPtr<IInStream> Stream;
};


struct CMvItem
{
unsigned VolumeIndex;
unsigned ItemIndex;
};


class CMvDatabaseEx
{
bool AreItemsEqual(unsigned i1, unsigned i2);
Expand Down
9 changes: 7 additions & 2 deletions CPP/7zip/Archive/ComHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,23 +571,28 @@ HRESULT CDatabase::Open(IInStream *inStream)
RINOK(AddNode(-1, root.SonDid));

unsigned numCabs = 0;

FOR_VECTOR (i, Refs)
{
const CItem &item = Items[Refs[i].Did];
if (item.IsDir() || numCabs > 1)
continue;
bool isMsiName;
UString msiName = ConvertName(item.Name, isMsiName);
if (isMsiName)
if (isMsiName && !msiName.IsEmpty())
{
bool isThereExt = (msiName.Find(L'.') >= 0);
bool isMsiSpec = (msiName[0] == k_Msi_SpecChar);
if (msiName.Len() >= 4 && StringsAreEqualNoCase_Ascii(msiName.RightPtr(4), ".cab")
|| msiName.Len() >= 3 && msiName[0] != k_Msi_SpecChar && StringsAreEqualNoCase_Ascii(msiName.RightPtr(3), "exe"))
|| !isMsiSpec && msiName.Len() >= 3 && StringsAreEqualNoCase_Ascii(msiName.RightPtr(3), "exe")
|| !isMsiSpec && !isThereExt)
{
numCabs++;
MainSubfile = i;
}
}
}

if (numCabs > 1)
MainSubfile = -1;

Expand Down
Loading

0 comments on commit 9608215

Please sign in to comment.