Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CPP/7zip/7zip_gcc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,8 @@ $O/DefaultName.o: ../../UI/Common/DefaultName.cpp
$(CXX) $(CXXFLAGS) $<
$O/EnumDirItems.o: ../../UI/Common/EnumDirItems.cpp
$(CXX) $(CXXFLAGS) $<
$O/ChainedExtract.o: ../../UI/Common/ChainedExtract.cpp
$(CXX) $(CXXFLAGS) $<
$O/Extract.o: ../../UI/Common/Extract.cpp
$(CXX) $(CXXFLAGS) $<
$O/ExtractingFilePath.o: ../../UI/Common/ExtractingFilePath.cpp
Expand Down
11 changes: 7 additions & 4 deletions CPP/7zip/Archive/Tar/TarHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,15 +730,18 @@ Z7_COM7F_IMF(CHandler::Extract(const UInt32 *indices, UInt32 numItems,
stream = _stream;

const bool allFilesMode = (numItems == (UInt32)(Int32)-1);
if (allFilesMode)
if (allFilesMode && !seqMode)
numItems = _items.Size();
if (_stream && numItems == 0)
return S_OK;
UInt64 totalSize = 0;
UInt32 i;
for (i = 0; i < numItems; i++)
totalSize += _items[allFilesMode ? i : indices[i]].Get_UnpackSize();
RINOK(extractCallback->SetTotal(totalSize))
if (!(seqMode && allFilesMode))
{
for (i = 0; i < numItems; i++)
totalSize += _items[allFilesMode ? i : indices[i]].Get_UnpackSize();
RINOK(extractCallback->SetTotal(totalSize))
}

UInt64 totalPackSize;
totalSize = totalPackSize = 0;
Expand Down
4 changes: 4 additions & 0 deletions CPP/7zip/Archive/Tar/TarIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ HRESULT CArchive::GetNextItemReal(CItemEx &item)
filled = false;

bool thereAreEmptyRecords = false;
unsigned numEmptyRecords = 0;
for (;;)
{
size_t processedSize = NFileHeader::kRecordSize;
Expand Down Expand Up @@ -219,6 +220,9 @@ HRESULT CArchive::GetNextItemReal(CItemEx &item)
break;
item.HeaderSize += NFileHeader::kRecordSize;
thereAreEmptyRecords = true;
numEmptyRecords++;
if (!InStream && numEmptyRecords >= 2)
return S_OK;
RINOK(Progress(item, 0))
}
if (thereAreEmptyRecords)
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/Bundles/Alone/makefile.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ UI_COMMON_OBJS = \
$O/Bench.o \
$O/DefaultName.o \
$O/EnumDirItems.o \
$O/ChainedExtract.o \
$O/Extract.o \
$O/ExtractingFilePath.o \
$O/HashCalc.o \
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/Bundles/Alone7z/makefile.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ UI_COMMON_OBJS = \
$O/Bench.o \
$O/DefaultName.o \
$O/EnumDirItems.o \
$O/ChainedExtract.o \
$O/Extract.o \
$O/ExtractingFilePath.o \
$O/HashCalc.o \
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/Bundles/Fm/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ UI_COMMON_OBJS = \
$O\CompressCall2.obj \
$O\DefaultName.obj \
$O\EnumDirItems.obj \
$O\ChainedExtract.obj \
$O\Extract.obj \
$O\ExtractingFilePath.obj \
$O\HashCalc.obj \
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/Bundles/SFXCon/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ UI_COMMON_OBJS = \
$O\ArchiveExtractCallback.obj \
$O\ArchiveOpenCallback.obj \
$O\DefaultName.obj \
$O\ChainedExtract.obj \
$O\Extract.obj \
$O\ExtractingFilePath.obj \
$O\LoadCodecs.obj \
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/Bundles/SFXCon/makefile.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ UI_COMMON_OBJS = \
$O/ArchiveExtractCallback.o \
$O/ArchiveOpenCallback.o \
$O/DefaultName.o \
$O/ChainedExtract.o \
$O/Extract.o \
$O/ExtractingFilePath.o \
$O/LoadCodecs.o \
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/Bundles/SFXWin/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ UI_COMMON_OBJS = \
$O\ArchiveExtractCallback.obj \
$O\ArchiveOpenCallback.obj \
$O\DefaultName.obj \
$O\ChainedExtract.obj \
$O\Extract.obj \
$O\ExtractingFilePath.obj \
$O\LoadCodecs.obj \
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/Common/StreamBinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#ifndef ZIP7_INC_STREAM_BINDER_H
#define ZIP7_INC_STREAM_BINDER_H

#include "../../Common/MyCom.h"
#include "../../Windows/Synchronization.h"

#include "../IStream.h"
Expand Down
5 changes: 5 additions & 0 deletions CPP/7zip/UI/Common/ArchiveCommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ enum Enum
kUseSlashMark,
kDisableWildcardParsing,
kElimDup,
kChainedExtract,
kFullPathMode,

kHardLinks,
Expand Down Expand Up @@ -338,6 +339,7 @@ static const CSwitchForm kSwitchForms[] =
{ "spm", SWFRM_STRING_SINGL(0) },
{ "spd", SWFRM_SIMPLE },
{ "spe", SWFRM_MINUS },
{ "sce", SWFRM_MINUS },
{ "spf", SWFRM_STRING_SINGL(0) },

{ "snh", SWFRM_MINUS },
Expand Down Expand Up @@ -1358,6 +1360,9 @@ void CArcCmdLineParser::Parse2(CArcCmdLineOptions &options)
options.ExtractOptions.ElimDup.Def = true;
options.ExtractOptions.ElimDup.Val = !parser[NKey::kElimDup].WithMinus;
}

if (parser[NKey::kChainedExtract].ThereIs)
options.ExtractOptions.EnableChainedExtract = !parser[NKey::kChainedExtract].WithMinus;

NWildcard::ECensorPathMode censorPathMode = NWildcard::k_RelatPath;
bool fullPathMode = parser[NKey::kFullPathMode].ThereIs;
Expand Down
11 changes: 10 additions & 1 deletion CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ CArchiveExtractCallback::CArchiveExtractCallback():
// Write_MTime(true),
Is_elimPrefix_Mode(false),
_arc(NULL),
_multiArchives(false)
_multiArchives(false),
_disableProgress(false)
{
#ifdef Z7_USE_SECURITY_CODE
_saclEnabled = InitLocalPrivileges();
Expand All @@ -311,6 +312,7 @@ CArchiveExtractCallback::CArchiveExtractCallback():

void CArchiveExtractCallback::InitBeforeNewArchive()
{
_disableProgress = false;
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
ZoneBuf.Free();
#endif
Expand Down Expand Up @@ -403,6 +405,8 @@ Z7_COM7F_IMF(CArchiveExtractCallback::SetTotal(UInt64 size))
COM_TRY_BEGIN
_progressTotal = size;
// _progressTotal_Defined = true;
if (_disableProgress)
return S_OK;
if (!_multiArchives && _extractCallback2)
return _extractCallback2->SetTotal(size);
return S_OK;
Expand Down Expand Up @@ -438,6 +442,9 @@ Z7_COM7F_IMF(CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue))
if (!_extractCallback2)
return S_OK;

if (_disableProgress)
return S_OK;

UInt64 packCur;
if (_multiArchives)
{
Expand All @@ -455,6 +462,8 @@ Z7_COM7F_IMF(CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue))
Z7_COM7F_IMF(CArchiveExtractCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize))
{
COM_TRY_BEGIN
if (_disableProgress)
return S_OK;
return LocalProgressSpec.Interface()->SetRatioInfo(inSize, outSize);
COM_TRY_END
}
Expand Down
6 changes: 6 additions & 0 deletions CPP/7zip/UI/Common/ArchiveExtractCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ class CArchiveExtractCallback Z7_final:
bool _some_pathParts_wereRemoved;

bool _multiArchives;
bool _disableProgress;
bool _keepAndReplaceEmptyDirPrefixes; // replace them to "_";
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
bool _saclEnabled;
Expand Down Expand Up @@ -529,6 +530,11 @@ class CArchiveExtractCallback Z7_final:

void InitBeforeNewArchive();

void DisableProgress()
{
_disableProgress = true;
}

void Init(
const CExtractNtOptions &ntOptions,
const NWildcard::CCensorNode *wildcardCensor,
Expand Down
Loading