ObjFW  Diff

Differences From Artifact [5c5bcb3795]:

  • File utils/ofarc/OFArc.m — part of check-in [f2109cf1c3] at 2023-07-22 14:47:51 on branch trunk — utils/ofarc: Pass the path of the archive This is in preparation for supporting split archives. (user: js size: 21893) [more...]

To Artifact [732031f459]:

  • File utils/ofarc/OFArc.m — part of check-in [d93bcda0b2] at 2023-08-25 23:32:14 on branch trunk — Fix nullability issues found by clang-analyzer (user: js size: 22002) [more...]

484
485
486
487
488
489
490
491
492
493
494
495


496
497
498
499
500
501
502
		help(OFStdErr, true, 1);
		break;
	}

	[OFApplication terminateWithStatus: _exitStatus];
}

- (id <Archive>)openArchiveWithPath: (OFString *)path
			       type: (OFString *)type
			       mode: (char)mode
			   encoding: (OFStringEncoding)encoding
{


	OFString *modeString, *fileModeString;
	OFStream *file = nil;
	id <Archive> archive = nil;

	[_archivePath release];
	_archivePath = [path copy];








|




>
>







484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
		help(OFStdErr, true, 1);
		break;
	}

	[OFApplication terminateWithStatus: _exitStatus];
}

- (id <Archive>)openArchiveWithPath: (OFString *)path_
			       type: (OFString *)type
			       mode: (char)mode
			   encoding: (OFStringEncoding)encoding
{
	/* To make clang-analyzer happy about assigning nil to path later. */
	OFString *path = path_;
	OFString *modeString, *fileModeString;
	OFStream *file = nil;
	id <Archive> archive = nil;

	[_archivePath release];
	_archivePath = [path copy];

643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
		writingNotSupported(type);
		goto error;
	}

	return archive;

error:
	if (mode == 'c')
		[[OFFileManager defaultManager] removeItemAtPath: path];

	[OFApplication terminateWithStatus: 1];
	return nil;
}

- (bool)shouldExtractFile: (OFString *)fileName
	      outFileName: (OFString *)outFileName
{
	OFString *line;








|



|







645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
		writingNotSupported(type);
		goto error;
	}

	return archive;

error:
	if (mode == 'c' && path != nil)
		[[OFFileManager defaultManager] removeItemAtPath: path];

	[OFApplication terminateWithStatus: 1];
	abort();
}

- (bool)shouldExtractFile: (OFString *)fileName
	      outFileName: (OFString *)outFileName
{
	OFString *line;