This commit is contained in:
Igor Pavlov
2015-09-22 00:00:00 +00:00
committed by Kornel Lesiński
parent cba375916f
commit f6444c3256
96 changed files with 7301 additions and 2409 deletions

View File

@@ -216,10 +216,9 @@ void CArchiveExtractCallback::Init(
// _progressTotal = 0;
// _progressTotal_Defined = false;
_progressTotal = _packTotal;
_progressTotal_Defined = true;
_packTotal = packSize;
_progressTotal = packSize;
_progressTotal_Defined = true;
_extractCallback2 = extractCallback2;
_compressProgress.Release();
@@ -962,7 +961,12 @@ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
bool isAnti = false;
RINOK(_arc->IsItemAnti(index, isAnti));
Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, pathParts, _item.MainIsDir);
#ifdef SUPPORT_ALT_STREAMS
if (!_item.IsAltStream
|| !pathParts.IsEmpty()
|| !(_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt))
#endif
Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, pathParts, _item.MainIsDir);
#ifdef SUPPORT_ALT_STREAMS
@@ -970,12 +974,18 @@ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
{
UString s = _item.AltStreamName;
Correct_AltStream_Name(s);
bool needColon = ((!_removePartsForAltStreams && _pathMode != NExtract::NPathMode::kNoPathsAlt) || !pathParts.IsEmpty());
bool needColon = true;
if (pathParts.IsEmpty())
{
pathParts.AddNew();
if (_pathMode == NExtract::NPathMode::kAbsPaths &&
if (_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt)
needColon = false;
}
else if (_pathMode == NExtract::NPathMode::kAbsPaths &&
NWildcard::GetNumPrefixParts_if_DrivePath(pathParts) == pathParts.Size())
pathParts.AddNew();
UString &name = pathParts.Back();
if (needColon)
name += (wchar_t)(_ntOptions.ReplaceColonForAltStream ? L'_' : L':');

View File

@@ -17,7 +17,9 @@ static void ReplaceIncorrectChars(UString &s)
if (
#ifdef _WIN32
c == ':' || c == '*' || c == '?' || c < 0x20 || c == '<' || c == '>' || c == '|' || c == '"'
|| c == '/' ||
|| c == '/'
|| c == 0x202E // RLO
||
#endif
c == WCHAR_PATH_SEPARATOR)
s.ReplaceOneCharAtPos(i, '_');
@@ -53,7 +55,9 @@ void Correct_AltStream_Name(UString &s)
for (unsigned i = 0; i < len; i++)
{
wchar_t c = s[i];
if (c == ':' || c == '\\' || c == '/')
if (c == ':' || c == '\\' || c == '/'
|| c == 0x202E // RLO
)
s.ReplaceOneCharAtPos(i, '_');
}
if (s.IsEmpty())

View File

@@ -299,6 +299,8 @@ public:
UInt64 AvailPhySize; // PhySize, but it's reduced if exceed end of file
// bool offsetDefined;
UInt64 GetEstmatedPhySize() const { return PhySizeDefined ? PhySize : FileSize; }
UInt64 ArcStreamOffset; // offset of stream that is open by Archive Handler
Int64 GetGlobalOffset() const { return ArcStreamOffset + Offset; } // it's global offset of archive