@@ -46,11 +46,11 @@ @implementation GZIPArchive + (void)initialize { if (self == [GZIPArchive class]) - app = (OFArc *)[[OFApplication sharedApplication] delegate]; + app = (OFArc *)[OFApplication sharedApplication].delegate; } + (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream mode: (OFString *)mode encoding: (of_string_encoding_t)encoding @@ -94,20 +94,20 @@ - (void)extractFiles: (OFArray OF_GENERIC(OFString *) *)files { OFString *fileName; OFFile *output; - if ([files count] != 0) { + if (files.count != 0) { [of_stderr writeLine: OF_LOCALIZED(@"cannot_extract_specific_file_from_gz", @"Cannot extract a specific file of a .gz archive!")]; app->_exitStatus = 1; return; } - fileName = [[app->_archivePath lastPathComponent] - stringByDeletingPathExtension]; + fileName = app->_archivePath.lastPathComponent + .stringByDeletingPathExtension; if (app->_outputLevel >= 0) [of_stdout writeString: OF_LOCALIZED(@"extracting_file", @"Extracting %[file]...", @"file", fileName)]; @@ -118,11 +118,11 @@ output = [OFFile fileWithPath: fileName mode: @"w"]; setPermissions(fileName, app->_archivePath); - while (![_stream isAtEndOfStream]) { + while (!_stream.atEndOfStream) { ssize_t length = [app copyBlockFromStream: _stream toStream: output fileName: fileName]; if (length < 0) { @@ -139,22 +139,22 @@ } } - (void)printFiles: (OFArray OF_GENERIC(OFString *) *)files { - OFString *fileName = [[app->_archivePath lastPathComponent] - stringByDeletingPathExtension]; + OFString *fileName = app->_archivePath.lastPathComponent + .stringByDeletingPathExtension; - if ([files count] > 0) { + if (files.count > 0) { [of_stderr writeLine: OF_LOCALIZED( @"cannot_print_specific_file_from_gz", @"Cannot print a specific file of a .gz archive!")]; app->_exitStatus = 1; return; } - while (![_stream isAtEndOfStream]) { + while (!_stream.atEndOfStream) { ssize_t length = [app copyBlockFromStream: _stream toStream: of_stdout fileName: fileName]; if (length < 0) {