ObjFW  Diff

Differences From Artifact [2c4547e53e]:

  • File src/OFTarArchive.m — part of check-in [9d802a786d] at 2025-01-01 12:58:18 on branch trunk — Update copyright (user: js size: 11470) [more...]

To Artifact [69ca8916c3]:

  • File src/OFTarArchive.m — part of check-in [ac61f5f0e6] at 2025-04-09 23:46:42 on branch trunk — Fix compiling on macOS Leopard (user: js size: 11450)

514
515
516
517
518
519
520
521

522
523
524
525
526
527
528
529

530
531

532
533
534
535
536

537
538
539
540
541
542
543
514
515
516
517
518
519
520

521
522
523
524
525
526
527
528

529
530

531
532
533
534
535

536
537
538
539
540
541
542
543







-
+







-
+

-
+




-
+







{
	return ((id <OFReadyForWritingObserving>)_stream)
	    .fileDescriptorForWriting;
}

- (void)close
{
	unsigned long long remainder;
	unsigned long long rest;

	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_toWrite > 0)
		@throw [OFTruncatedDataException exception];

	remainder = 512 - _entry.uncompressedSize % 512;
	rest = 512 - _entry.uncompressedSize % 512;

	if (remainder != 512) {
	if (rest != 512) {
		bool didBufferWrites = _stream.buffersWrites;

		_stream.buffersWrites = true;

		while (remainder--)
		while (rest--)
			[_stream writeInt8: 0];

		[_stream flushWriteBuffer];
		_stream.buffersWrites = didBufferWrites;
	}

	[_stream release];