"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "CPP/7zip/UI/Common/OpenArchive.cpp" between
p7zip_15.14.1_src_all.tar.gz and p7zip_16.02_src_all.tar.gz

About: p7zip is a command-line file archiver with a high compression ratio (a port of the Windows program 7za.exe).

OpenArchive.cpp  (p7zip_15.14.1_src_all):OpenArchive.cpp  (p7zip_16.02_src_all)
skipping to change at line 495 skipping to change at line 495
} }
static HRESULT Archive_GetArcProp_UInt(IInArchive *arc, PROPID propid, UInt64 &r esult, bool &defined) static HRESULT Archive_GetArcProp_UInt(IInArchive *arc, PROPID propid, UInt64 &r esult, bool &defined)
{ {
defined = false; defined = false;
NCOM::CPropVariant prop; NCOM::CPropVariant prop;
RINOK(arc->GetArchiveProperty(propid, &prop)); RINOK(arc->GetArchiveProperty(propid, &prop));
switch (prop.vt) switch (prop.vt)
{ {
case VT_UI4: result = prop.ulVal; defined = true; break; case VT_UI4: result = prop.ulVal; defined = true; break;
case VT_I4: result = prop.lVal; defined = true; break; case VT_I4: result = (Int64)prop.lVal; defined = true; break;
case VT_UI8: result = (UInt64)prop.uhVal.QuadPart; defined = true; break; case VT_UI8: result = (UInt64)prop.uhVal.QuadPart; defined = true; break;
case VT_I8: result = (UInt64)prop.hVal.QuadPart; defined = true; break; case VT_I8: result = (UInt64)prop.hVal.QuadPart; defined = true; break;
case VT_EMPTY: break; case VT_EMPTY: break;
default: return E_FAIL; default: return E_FAIL;
} }
return S_OK; return S_OK;
} }
static HRESULT Archive_GetArcProp_Int(IInArchive *arc, PROPID propid, Int64 &res ult, bool &defined) static HRESULT Archive_GetArcProp_Int(IInArchive *arc, PROPID propid, Int64 &res ult, bool &defined)
{ {
skipping to change at line 580 skipping to change at line 580
parts.Insert(0, s.Ptr(pos + 1)); parts.Insert(0, s.Ptr(pos + 1));
s.DeleteFrom(pos); s.DeleteFrom(pos);
} }
} }
parts.Insert(0, s); parts.Insert(0, s);
if (prevWasAltStream) if (prevWasAltStream)
{ {
{ {
UString &s = parts[parts.Size() - 2]; UString &s2 = parts[parts.Size() - 2];
s += L':'; s2 += L':';
s += parts.Back(); s2 += parts.Back();
} }
parts.DeleteBack(); parts.DeleteBack();
} }
if (parent == curParent) if (parent == curParent)
return S_OK; return S_OK;
prevWasAltStream = false; prevWasAltStream = false;
if (parentType == NParentType::kAltStream) if (parentType == NParentType::kAltStream)
prevWasAltStream = true; prevWasAltStream = true;
skipping to change at line 862 skipping to change at line 862
if (item.WriteToAltStreamIfColon || needFindAltStream) if (item.WriteToAltStreamIfColon || needFindAltStream)
{ {
/* Good handler must support GetRawProps::GetParent for alt streams./ /* Good handler must support GetRawProps::GetParent for alt streams./
So the following code currently is not used */ So the following code currently is not used */
int colon = FindAltStreamColon_in_Path(item.Path); int colon = FindAltStreamColon_in_Path(item.Path);
if (colon >= 0) if (colon >= 0)
{ {
item.MainPath.DeleteFrom(colon); item.MainPath.DeleteFrom(colon);
item.AltStreamName = item.Path.Ptr(colon + 1); item.AltStreamName = item.Path.Ptr(colon + 1);
item.MainIsDir = (colon == 0 || IsPathSepar(item.Path[colon - 1])); item.MainIsDir = (colon == 0 || IsPathSepar(item.Path[(unsigned)colon - 1] ));
item.IsAltStream = true; item.IsAltStream = true;
} }
} }
#endif #endif
#ifndef _SFX #ifndef _SFX
if (item._use_baseParentFolder_mode) if (item._use_baseParentFolder_mode)
{ {
RINOK(GetItemPathToParent(mainIndex, item._baseParentFolder, item.PathParts) ); RINOK(GetItemPathToParent(mainIndex, item._baseParentFolder, item.PathParts) );
skipping to change at line 1625 skipping to change at line 1625
searchMarkerInHandler = true; searchMarkerInHandler = true;
} }
else else
{ {
unsigned numFinded = 0; unsigned numFinded = 0;
#ifndef _SFX #ifndef _SFX
bool isPrearcExt = false; bool isPrearcExt = false;
#endif #endif
{ {
#ifndef _SFX
bool isZip = false;
bool isRar = false;
const wchar_t c = extension[0];
if (c == 'z' || c == 'Z' || c == 'r' || c == 'R')
{
bool isNumber = false;
for (unsigned k = 1;; k++)
{
const wchar_t d = extension[k];
if (d == 0)
break;
if (d < '0' || d > '9')
{
isNumber = false;
break;
}
isNumber = true;
}
if (isNumber)
if (c == 'z' || c == 'Z')
isZip = true;
else
isRar = true;
}
#endif
FOR_VECTOR (i, op.codecs->Formats) FOR_VECTOR (i, op.codecs->Formats)
{ {
const CArcInfoEx &ai = op.codecs->Formats[i]; const CArcInfoEx &ai = op.codecs->Formats[i];
if (IgnoreSplit || !op.openType.CanReturnArc) if (IgnoreSplit || !op.openType.CanReturnArc)
if (ai.IsSplit()) if (ai.IsSplit())
continue; continue;
if (op.excludedFormats->FindInSorted(i) >= 0) if (op.excludedFormats->FindInSorted(i) >= 0)
continue; continue;
#ifndef _SFX #ifndef _SFX
if (IsPreArcFormat(ai)) if (IsPreArcFormat(ai))
isPrearcExt = true; isPrearcExt = true;
#endif #endif
if (ai.FindExtension(extension) >= 0) if (ai.FindExtension(extension) >= 0
#ifndef _SFX
|| isZip && StringsAreEqualNoCase_Ascii(ai.Name, "zip")
|| isRar && StringsAreEqualNoCase_Ascii(ai.Name, "rar")
#endif
)
{ {
// PrintNumber("orderIndices.Insert", i); // PrintNumber("orderIndices.Insert", i);
orderIndices.Insert(numFinded++, i); orderIndices.Insert(numFinded++, i);
isMainFormatArr[i] = true; isMainFormatArr[i] = true;
} }
else else
orderIndices.Add(i); orderIndices.Add(i);
} }
} }
skipping to change at line 1966 skipping to change at line 2001
if (mode.MaxStartOffset_Defined) if (mode.MaxStartOffset_Defined)
{ {
if (mode.MaxStartOffset == 0) if (mode.MaxStartOffset == 0)
return S_FALSE; return S_FALSE;
} }
else else
{ {
const CArcInfoEx &ai = op.codecs->Formats[formatIndex]; const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
if (ai.FindExtension(extension) >= 0) if (ai.FindExtension(extension) >= 0)
{ {
const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
if (ai.Flags_FindSignature() && searchMarkerInHandler) if (ai.Flags_FindSignature() && searchMarkerInHandler)
return S_FALSE; return S_FALSE;
} }
} }
} }
NArchive::NParser::CHandler *handlerSpec = new NArchive::NParser::CHandler; NArchive::NParser::CHandler *handlerSpec = new NArchive::NParser::CHandler;
CMyComPtr<IInArchive> handler = handlerSpec; CMyComPtr<IInArchive> handler = handlerSpec;
CExtractCallback_To_OpenCallback *extractCallback_To_OpenCallback_Spec = new C ExtractCallback_To_OpenCallback; CExtractCallback_To_OpenCallback *extractCallback_To_OpenCallback_Spec = new C ExtractCallback_To_OpenCallback;
skipping to change at line 3402 skipping to change at line 3436
type.MaxStartOffset_Defined = true; type.MaxStartOffset_Defined = true;
return true; return true;
} }
return false; return false;
} }
bool ParseType(CCodecs &codecs, const UString &s, COpenType &type) bool ParseType(CCodecs &codecs, const UString &s, COpenType &type)
{ {
int pos2 = s.Find(L':'); int pos2 = s.Find(L':');
{
UString name; UString name;
if (pos2 < 0) if (pos2 < 0)
{ {
name = s; name = s;
pos2 = s.Len(); pos2 = s.Len();
} }
else else
{ {
name = s.Left(pos2); name = s.Left(pos2);
pos2++; pos2++;
skipping to change at line 3437 skipping to change at line 3473
return false; return false;
type.CanReturnArc = false; type.CanReturnArc = false;
type.CanReturnParser = true; type.CanReturnParser = true;
} }
else else
return false; return false;
} }
type.FormatIndex = index; type.FormatIndex = index;
}
for (unsigned i = pos2; i < s.Len();) for (unsigned i = pos2; i < s.Len();)
{ {
int next = s.Find(L':', i); int next = s.Find(L':', i);
if (next < 0) if (next < 0)
next = s.Len(); next = s.Len();
UString name = s.Mid(i, next - i); const UString name = s.Mid(i, next - i);
if (name.IsEmpty()) if (name.IsEmpty())
return false; return false;
if (!ParseTypeParams(name, type)) if (!ParseTypeParams(name, type))
return false; return false;
i = next + 1; i = next + 1;
} }
return true; return true;
} }
 End of changes. 9 change blocks. 
8 lines changed or deleted 46 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS