diff options
Diffstat (limited to 'CPP/7zip')
-rw-r--r-- | CPP/7zip/Archive/7z/7zHandler.cpp | 20 | ||||
-rw-r--r-- | CPP/7zip/Archive/Iso/IsoHandler.cpp | 2 | ||||
-rw-r--r-- | CPP/7zip/Archive/Zip/ZipUpdate.cpp | 5 | ||||
-rw-r--r-- | CPP/7zip/Bundles/Alone7z/makefile | 2 | ||||
-rw-r--r-- | CPP/7zip/Bundles/LzmaCon/resource.rc | 2 | ||||
-rw-r--r-- | CPP/7zip/Bundles/SFXCon/resource.rc | 2 | ||||
-rw-r--r-- | CPP/7zip/Bundles/SFXSetup/resource.rc | 2 | ||||
-rw-r--r-- | CPP/7zip/Bundles/SFXWin/resource.rc | 2 | ||||
-rw-r--r-- | CPP/7zip/UI/Agent/Agent.cpp | 2 | ||||
-rw-r--r-- | CPP/7zip/UI/Client7z/resource.rc | 2 | ||||
-rw-r--r-- | CPP/7zip/UI/Common/DirItem.h | 2 | ||||
-rw-r--r-- | CPP/7zip/UI/Console/Main.cpp | 10 |
12 files changed, 32 insertions, 21 deletions
diff --git a/CPP/7zip/Archive/7z/7zHandler.cpp b/CPP/7zip/Archive/7z/7zHandler.cpp index 82983419..af673a73 100644 --- a/CPP/7zip/Archive/7z/7zHandler.cpp +++ b/CPP/7zip/Archive/7z/7zHandler.cpp @@ -321,11 +321,16 @@ STDMETHODIMP CHandler::GetRawProp(UInt32 index, PROPID propID, const void **data if (/* _db.IsTree && propID == kpidName || !_db.IsTree && */ propID == kpidPath) { - *data = (void *)_db.GetName(index); - if (*data) + const wchar_t *name = _db.GetName(index); + if (name) { - *dataSize = (UInt32)((_db.NameOffsets[index + 1] - _db.NameOffsets[index]) * 2); - *propType = NPropDataType::kUtf16z; + size_t size = (_db.NameOffsets[index + 1] - _db.NameOffsets[index]) * 2; + if (size < ((UInt32)1 << 31)) + { + *data = (void *)name; + *dataSize = (UInt32)size; + *propType = NPropDataType::kUtf16z; + } } return S_OK; } @@ -382,6 +387,13 @@ HRESULT CHandler::SetMethodToProp(CNum folderIndex, PROPVARIANT *prop) const for (unsigned j = 0; j < idSize; j++) id64 = ((id64 << 8) | longID[j]); inByte.SkipDataNoCheck(idSize); + + if ((mainByte & 0x10) != 0) + { + inByte.ReadNum(); // NumInStreams + inByte.ReadNum(); // NumOutStreams + } + CNum propsSize = 0; const Byte *props = NULL; if ((mainByte & 0x20) != 0) diff --git a/CPP/7zip/Archive/Iso/IsoHandler.cpp b/CPP/7zip/Archive/Iso/IsoHandler.cpp index fc984048..eaa94bd8 100644 --- a/CPP/7zip/Archive/Iso/IsoHandler.cpp +++ b/CPP/7zip/Archive/Iso/IsoHandler.cpp @@ -322,7 +322,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems, if (e != 0) lps->InSize = lps->OutSize = currentTotalSize + offset; const CDir &item2 = ref.Dir->_subItems[ref.Index + e]; - RINOK(_stream->Seek(item2.ExtentLocation * _archive.BlockSize, STREAM_SEEK_SET, NULL)); + RINOK(_stream->Seek((UInt64)item2.ExtentLocation * _archive.BlockSize, STREAM_SEEK_SET, NULL)); streamSpec->Init(item2.Size); RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); if (copyCoderSpec->TotalSize != item2.Size) diff --git a/CPP/7zip/Archive/Zip/ZipUpdate.cpp b/CPP/7zip/Archive/Zip/ZipUpdate.cpp index 2978e387..97cce5ac 100644 --- a/CPP/7zip/Archive/Zip/ZipUpdate.cpp +++ b/CPP/7zip/Archive/Zip/ZipUpdate.cpp @@ -534,13 +534,14 @@ static HRESULT Update2( #ifndef _7ZIP_ST - const size_t kNumMaxThreads = (1 << 10); UInt32 numThreads = options->NumThreads; + const UInt32 kNumMaxThreads = 64; if (numThreads > kNumMaxThreads) numThreads = kNumMaxThreads; + if (numThreads > MAXIMUM_WAIT_OBJECTS) // is 64 in Windows (is it 64 in all versions?) + numThreads = MAXIMUM_WAIT_OBJECTS; if (numThreads < 1) numThreads = 1; - const size_t kMemPerThread = (1 << 25); const size_t kBlockSize = 1 << 16; diff --git a/CPP/7zip/Bundles/Alone7z/makefile b/CPP/7zip/Bundles/Alone7z/makefile index 9f7ef516..84b235eb 100644 --- a/CPP/7zip/Bundles/Alone7z/makefile +++ b/CPP/7zip/Bundles/Alone7z/makefile @@ -1,6 +1,6 @@ PROG = 7zr.exe MY_CONSOLE = 1 -CFLAGS = $(CFLAGS) \ +CFLAGS = $(CFLAGS) -DPROG_VARIANT_R !IFNDEF UNDER_CE CFLAGS = $(CFLAGS) -DWIN_LONG_PATH diff --git a/CPP/7zip/Bundles/LzmaCon/resource.rc b/CPP/7zip/Bundles/LzmaCon/resource.rc index 43b50738..c68fdcc0 100644 --- a/CPP/7zip/Bundles/LzmaCon/resource.rc +++ b/CPP/7zip/Bundles/LzmaCon/resource.rc @@ -1,3 +1,3 @@ -#include "../../MyVersionInfo.rc" +#include "../../../../C/7zVersion.rc" MY_VERSION_INFO_APP("LZMA", "lzma") diff --git a/CPP/7zip/Bundles/SFXCon/resource.rc b/CPP/7zip/Bundles/SFXCon/resource.rc index 58331b81..a83581c2 100644 --- a/CPP/7zip/Bundles/SFXCon/resource.rc +++ b/CPP/7zip/Bundles/SFXCon/resource.rc @@ -1,4 +1,4 @@ -#include "../../MyVersionInfo.rc" +#include "../../../../C/7zVersion.rc" MY_VERSION_INFO_APP("7z Console SFX", "7z.sfx") diff --git a/CPP/7zip/Bundles/SFXSetup/resource.rc b/CPP/7zip/Bundles/SFXSetup/resource.rc index 47e1b762..8819a2c8 100644 --- a/CPP/7zip/Bundles/SFXSetup/resource.rc +++ b/CPP/7zip/Bundles/SFXSetup/resource.rc @@ -1,4 +1,4 @@ -#include "../../MyVersionInfo.rc" +#include "../../../../C/7zVersion.rc" #include "resource.h" MY_VERSION_INFO_APP("7z Setup SFX", "7zS.sfx") diff --git a/CPP/7zip/Bundles/SFXWin/resource.rc b/CPP/7zip/Bundles/SFXWin/resource.rc index 91292b2f..ccde0cb2 100644 --- a/CPP/7zip/Bundles/SFXWin/resource.rc +++ b/CPP/7zip/Bundles/SFXWin/resource.rc @@ -1,4 +1,4 @@ -#include "../../MyVersionInfo.rc" +#include "../../../../C/7zVersion.rc" #include "../../GuiCommon.rc" #include "../../UI/GUI/ExtractDialogRes.h" #include "../../UI/FileManager/PropertyNameRes.h" diff --git a/CPP/7zip/UI/Agent/Agent.cpp b/CPP/7zip/UI/Agent/Agent.cpp index e4f46f0a..d8221754 100644 --- a/CPP/7zip/UI/Agent/Agent.cpp +++ b/CPP/7zip/UI/Agent/Agent.cpp @@ -195,6 +195,8 @@ STDMETHODIMP_(UInt64) CAgentFolder::GetItemSize(UInt32 index) const CProxyFolder &item = _proxyArchive->Folders[folder->Folders[realIndex]]; if (!_flatMode) return item.Size; + if (!item.IsLeaf) + return 0; arcIndex = item.Index; } else diff --git a/CPP/7zip/UI/Client7z/resource.rc b/CPP/7zip/UI/Client7z/resource.rc index a09bb044..1bb4d4e3 100644 --- a/CPP/7zip/UI/Client7z/resource.rc +++ b/CPP/7zip/UI/Client7z/resource.rc @@ -1,3 +1,3 @@ -#include "../../MyVersionInfo.rc" +#include "../../../../C/7zVersion.rc" MY_VERSION_INFO_APP("7-Zip client", "7zcl") diff --git a/CPP/7zip/UI/Common/DirItem.h b/CPP/7zip/UI/Common/DirItem.h index 4bb62b0e..ce48b582 100644 --- a/CPP/7zip/UI/Common/DirItem.h +++ b/CPP/7zip/UI/Common/DirItem.h @@ -24,7 +24,7 @@ struct CDirItem CByteBuffer ReparseData; CByteBuffer ReparseData2; // fixed (reduced) absolute links - bool AreReparseData() const { return ReparseData.Size() != 0 || !ReparseData2.Size() != 0; } + bool AreReparseData() const { return ReparseData.Size() != 0 || ReparseData2.Size() != 0; } #endif UInt32 Attrib; diff --git a/CPP/7zip/UI/Console/Main.cpp b/CPP/7zip/UI/Console/Main.cpp index 0038dba4..2f56fecb 100644 --- a/CPP/7zip/UI/Console/Main.cpp +++ b/CPP/7zip/UI/Console/Main.cpp @@ -43,11 +43,7 @@ #include "HashCon.h" -#if !defined(EXTERNAL_CODECS) && defined(_NO_CRYPTO) -#define IT_IS_REDUCED_VERSION -#endif - -#ifdef IT_IS_REDUCED_VERSION +#ifdef PROG_VARIANT_R #include "../../../../C/7zVersion.h" #else #include "../../MyVersion.h" @@ -64,7 +60,7 @@ extern CStdOutStream *g_StdStream; static const char *kCopyrightString = "\n7-Zip" #ifndef EXTERNAL_CODECS -#ifdef IT_IS_REDUCED_VERSION +#ifdef PROG_VARIANT_R " (r)" #else " (a)" @@ -80,7 +76,7 @@ static const char *kCopyrightString = "\n7-Zip" static const char *kHelpString = "\nUsage: 7z" #ifndef EXTERNAL_CODECS -#ifdef IT_IS_REDUCED_VERSION +#ifdef PROG_VARIANT_R "r" #else "a" |