Differences From Artifact [fee5d710b7]:
- File
utils/ofzip/OFZIP.m
— part of check-in
[40cf53506a]
at
2017-04-09 18:22:14
on branch trunk
— Add OFSandbox
Only OpenBSD's pledge() is supported so far. (user: js, size: 13734) [annotate] [blame] [check-ins using]
To Artifact [be1781ac4e]:
- File
utils/ofzip/OFZIP.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 13742) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
132 133 134 135 136 137 138 | { 't', @"type", 1, NULL, &type }, { 'v', @"verbose", 0, NULL, NULL }, { 'x', @"extract", 0, NULL, NULL }, { '\0', nil, 0, NULL, NULL } }; OFOptionsParser *optionsParser; of_unichar_t option, mode = '\0'; | | | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | { 't', @"type", 1, NULL, &type }, { 'v', @"verbose", 0, NULL, NULL }, { 'x', @"extract", 0, NULL, NULL }, { '\0', nil, 0, NULL, NULL } }; OFOptionsParser *optionsParser; of_unichar_t option, mode = '\0'; OFArray OF_GENERIC(OFString *) *remainingArguments, *files; id <Archive> archive; #ifdef OF_HAVE_SANDBOX OFSandbox *sandbox = [[OFSandbox alloc] init]; @try { [sandbox setAllowsStdIO: true]; [sandbox setAllowsReadingFiles: true]; |
︙ | ︙ | |||
293 294 295 296 297 298 299 | help(of_stderr, true, 1); break; } [OFApplication terminateWithStatus: _exitStatus]; } | | | | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | help(of_stderr, true, 1); break; } [OFApplication terminateWithStatus: _exitStatus]; } - (id <Archive>)openArchiveWithPath: (OFString *)path type: (OFString *)type { OFFile *file = nil; id <Archive> archive = nil; [_archivePath release]; _archivePath = [path copy]; |
︙ | ︙ | |||
380 381 382 383 384 385 386 | @"file", path)]; [OFApplication terminateWithStatus: 1]; } return archive; } | | | | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | @"file", path)]; [OFApplication terminateWithStatus: 1]; } return archive; } - (bool)shouldExtractFile: (OFString *)fileName outFileName: (OFString *)outFileName { OFString *line; if (_overwrite == 1 || ![[OFFileManager defaultManager] fileExistsAtPath: outFileName]) return true; |
︙ | ︙ | |||
438 439 440 441 442 443 444 | [of_stdout writeString: OF_LOCALIZED(@"extracting_file", @"Extracting %[file]...", @"file", fileName)]; return true; } | | | | | 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | [of_stdout writeString: OF_LOCALIZED(@"extracting_file", @"Extracting %[file]...", @"file", fileName)]; return true; } - (ssize_t)copyBlockFromStream: (OFStream *)input toStream: (OFStream *)output fileName: (OFString *)fileName { char buffer[BUFFER_SIZE]; size_t length; @try { length = [input readIntoBuffer: buffer length: BUFFER_SIZE]; |
︙ | ︙ |