"Fossies" - the Fresh Open Source Software Archive  

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

ArHandler.cpp  (p7zip_15.14.1_src_all):ArHandler.cpp  (p7zip_16.02_src_all)
skipping to change at line 344 skipping to change at line 344
if (_items[i].Name == "//") if (_items[i].Name == "//")
break; break;
if (i == _items.Size()) if (i == _items.Size())
return S_OK; return S_OK;
unsigned fileIndex = i; unsigned fileIndex = i;
const CItem &item = _items[fileIndex]; const CItem &item = _items[fileIndex];
if (item.Size > ((UInt32)1 << 30)) if (item.Size > ((UInt32)1 << 30))
return S_FALSE; return S_FALSE;
RINOK(stream->Seek(item.GetDataPos(), STREAM_SEEK_SET, NULL)); RINOK(stream->Seek(item.GetDataPos(), STREAM_SEEK_SET, NULL));
size_t size = (size_t)item.Size; const size_t size = (size_t)item.Size;
CByteArr p(size); CByteArr p(size);
RINOK(ReadStream_FALSE(stream, p, size)); RINOK(ReadStream_FALSE(stream, p, size));
for (i = 0; i < _items.Size(); i++) for (i = 0; i < _items.Size(); i++)
{ {
CItem &item = _items[i]; CItem &item2 = _items[i];
if (item.Name[0] != '/') if (item2.Name[0] != '/')
continue; continue;
const char *ptr = item.Name.Ptr(1); const char *ptr = item2.Name.Ptr(1);
const char *end; const char *end;
UInt32 pos = ConvertStringToUInt32(ptr, &end); UInt32 pos = ConvertStringToUInt32(ptr, &end);
if (*end != 0 || end == ptr) if (*end != 0 || end == ptr)
continue; continue;
if (pos >= size) if (pos >= size)
continue; continue;
UInt32 start = pos; UInt32 start = pos;
for (;;) for (;;)
{ {
if (pos >= size) if (pos >= size)
return S_FALSE; return S_FALSE;
char c = p[pos]; char c = p[pos];
if (c == 0 || c == 0x0A) if (c == 0 || c == 0x0A)
break; break;
pos++; pos++;
} }
item.Name.SetFrom((const char *)(p + start), pos - start); item2.Name.SetFrom((const char *)(p + start), pos - start);
} }
_longNames_FileIndex = fileIndex; _longNames_FileIndex = fileIndex;
return S_OK; return S_OK;
} }
void CHandler::ChangeDuplicateNames() void CHandler::ChangeDuplicateNames()
{ {
unsigned i; unsigned i;
for (i = 1; i < _items.Size(); i++) for (i = 1; i < _items.Size(); i++)
{ {
CItem &item = _items[i]; CItem &item = _items[i];
 End of changes. 6 change blocks. 
5 lines changed or deleted 7 lines changed or added

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