Write uncompressed package attributes if necessary

When compression doesn't save space, using it nonetheless results in a
file that the reader complains about. So we fall back to writing an
uncompressed package attributes section in such a case.

The same still needs to be done for the TOC section.
This commit is contained in:
Ingo Weinhold
2011-11-25 06:18:57 +01:00
parent 443be501c0
commit de9e64b235
2 changed files with 67 additions and 15 deletions
@@ -65,6 +65,12 @@ private:
void _WriteAttributeChildren(Attribute* attribute);
void _WritePackageAttributes(hpkg_header& header);
uint32 _WritePackageAttributesCompressed(
uint32& _stringsLengthUncompressed,
uint32& _attributesLengthUncompressed);
uint32 _WritePackageAttributesUncompressed(
uint32& _stringsLengthUncompressed,
uint32& _attributesLengthUncompressed);
void _AddEntry(int dirFD, Entry* entry,
const char* fileName, char* pathBuffer);