[squeak-dev] The Trunk: Compression-ar.19.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Aug 10 20:18:45 UTC 2010


Andreas Raab uploaded a new version of Compression to project The Trunk:
http://source.squeak.org/trunk/Compression-ar.19.mcz

==================== Summary ====================

Name: Compression-ar.19
Author: ar
Time: 10 August 2010, 1:18:33.227 pm
UUID: 85770924-100a-fc44-bbfa-1b7ab229e24c
Ancestors: Compression-nice.18

Fix handling of empty members in ZipArchives which would produce zips considered corrupt by other tools (unzip -t).

=============== Diff against Compression-nice.18 ===============

Item was changed:
  ----- Method: ZipArchiveMember>>writeDataTo: (in category 'private-writing') -----
  writeDataTo: aStream
  	"Copy my (possibly inflated or deflated) data to the given stream.
  	This might do compression, decompression, or straight copying, depending
  	on the values of compressionMethod and desiredCompressionMethod"
  
+ 	"Note: Do not shortcut this method if uncompressedSize = 0. Even in this case
+ 	data may be produced by the compressor (i.e., '' zipped size > 0) and must
+ 	be stored in the file or else other utilities will treat the zip file as corrupt."
- 	uncompressedSize = 0 ifTrue: [ ^self ].	"nothing to do because no data"
  
  	(compressionMethod = CompressionStored and: [ desiredCompressionMethod = CompressionDeflated ])
  		ifTrue: [ ^self compressDataTo: aStream ].
  
  	(compressionMethod = CompressionDeflated and: [ desiredCompressionMethod = CompressionStored ])
  		ifTrue: [ ^self uncompressDataTo: aStream ].
  
  	self copyDataTo: aStream.!




More information about the Squeak-dev mailing list