"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "CPP/7zip/UI/Agent/AgentProxy.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).

AgentProxy.cpp  (p7zip_15.14.1_src_all):AgentProxy.cpp  (p7zip_16.02_src_all)
skipping to change at line 37 skipping to change at line 37
const CRecordVector<unsigned> &subDirs = Dirs[dirIndex].SubDirs; const CRecordVector<unsigned> &subDirs = Dirs[dirIndex].SubDirs;
unsigned left = 0, right = subDirs.Size(); unsigned left = 0, right = subDirs.Size();
for (;;) for (;;)
{ {
if (left == right) if (left == right)
{ {
insertPos = left; insertPos = left;
return -1; return -1;
} }
unsigned mid = (left + right) / 2; unsigned mid = (left + right) / 2;
unsigned dirIndex = subDirs[mid]; unsigned dirIndex2 = subDirs[mid];
int compare = CompareFileNames(name, Dirs[dirIndex].Name); int compare = CompareFileNames(name, Dirs[dirIndex2].Name);
if (compare == 0) if (compare == 0)
return dirIndex; return dirIndex2;
if (compare < 0) if (compare < 0)
right = mid; right = mid;
else else
left = mid + 1; left = mid + 1;
} }
} }
int CProxyArc::FindSubDir(unsigned dirIndex, const wchar_t *name) const int CProxyArc::FindSubDir(unsigned dirIndex, const wchar_t *name) const
{ {
unsigned insertPos; unsigned insertPos;
skipping to change at line 307 skipping to change at line 307
if (arc.Ask_Deleted) if (arc.Ask_Deleted)
{ {
bool isDeleted = false; bool isDeleted = false;
RINOK(Archive_IsItem_Deleted(archive, i, isDeleted)); RINOK(Archive_IsItem_Deleted(archive, i, isDeleted));
if (isDeleted) if (isDeleted)
curItem = AddDirSubItem(curItem, (UInt32)(Int32)-1, false, L"[DELETED]") ; curItem = AddDirSubItem(curItem, (UInt32)(Int32)-1, false, L"[DELETED]") ;
} }
*/ */
unsigned namePos = 0; unsigned namePos = 0;
unsigned numLevels = 0;
for (unsigned j = 0; j < len; j++) for (unsigned j = 0; j < len; j++)
{ {
wchar_t c = s[j]; wchar_t c = s[j];
if (c == WCHAR_PATH_SEPARATOR || c == L'/') if (c == WCHAR_PATH_SEPARATOR || c == L'/')
{ {
name.SetFrom(s + namePos, j - namePos); const unsigned kLevelLimit = 1 << 10;
curItem = AddDir(curItem, -1, name); if (numLevels <= kLevelLimit)
{
if (numLevels == kLevelLimit)
name.SetFromAscii("[LONG_PATH]");
else
name.SetFrom(s + namePos, j - namePos);
curItem = AddDir(curItem, -1, name);
}
namePos = j + 1; namePos = j + 1;
numLevels++;
} }
} }
/* /*
that code must be implemeted to hide alt streams in list. that code must be implemeted to hide alt streams in list.
if (arc.Ask_AltStreams) if (arc.Ask_AltStreams)
{ {
bool isAltStream; bool isAltStream;
RINOK(Archive_IsItem_AltStream(archive, i, isAltStream)); RINOK(Archive_IsItem_AltStream(archive, i, isAltStream));
if (isAltStream) if (isAltStream)
 End of changes. 5 change blocks. 
5 lines changed or deleted 16 lines changed or added

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