Differences From Artifact [330cc9ede8]:
- File src/OFTarArchiveEntry.m — part of check-in [406134b5e2] at 2022-08-27 23:53:22 on branch trunk — OFArchiveEntry: Add more properties (user: js, size: 9186) [annotate] [blame] [check-ins using]
To Artifact [6db7373fe9]:
- File
src/OFTarArchiveEntry.m
— part of check-in
[6c08b57605]
at
2022-10-06 23:33:25
on branch trunk
— OFTarArchive: Make returned streams retain archive
In order to not create a retain cycle, this changes the reference to the
last returned stream to an unsafe unretained one that the stream itself
resets to nil in its dealloc. (user: js, size: 9261) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
308 309 310 311 312 313 314 315 316 317 318 319 320 321 | return [ret autorelease]; } - (void)of_writeToStream: (OFStream *)stream encoding: (OFStringEncoding)encoding { unsigned char buffer[512]; unsigned long long modificationDate; uint16_t checksum = 0; stringToBuffer(buffer, _fileName, 100, encoding); stringToBuffer(buffer + 100, [OFString stringWithFormat: @"%06o ", | > | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | return [ret autorelease]; } - (void)of_writeToStream: (OFStream *)stream encoding: (OFStringEncoding)encoding { void *pool = objc_autoreleasePoolPush(); unsigned char buffer[512]; unsigned long long modificationDate; uint16_t checksum = 0; stringToBuffer(buffer, _fileName, 100, encoding); stringToBuffer(buffer + 100, [OFString stringWithFormat: @"%06o ", |
︙ | ︙ | |||
359 360 361 362 363 364 365 | for (size_t i = 0; i < 500; i++) checksum += buffer[i]; stringToBuffer(buffer + 148, [OFString stringWithFormat: @"%06" PRIo16, checksum], 7, OFStringEncodingASCII); [stream writeBuffer: buffer length: sizeof(buffer)]; | | > > | 360 361 362 363 364 365 366 367 368 369 370 | for (size_t i = 0; i < 500; i++) checksum += buffer[i]; stringToBuffer(buffer + 148, [OFString stringWithFormat: @"%06" PRIo16, checksum], 7, OFStringEncodingASCII); [stream writeBuffer: buffer length: sizeof(buffer)]; objc_autoreleasePoolPop(pool); } @end |