Index: utils/OFZIP.m ================================================================== --- utils/OFZIP.m +++ utils/OFZIP.m @@ -31,10 +31,11 @@ #define BUFFER_SIZE 4096 @interface OFZIP: OFObject { int_fast8_t _override, _outputLevel; + int _exitStatus; } - (void)listFilesInArchive: (OFZIPArchive*)archive; - (void)extractFiles: (OFArray*)files fromArchive: (OFZIPArchive*)archive; @@ -133,11 +134,11 @@ default: help(of_stderr, true, 1); break; } - [OFApplication terminate]; + [OFApplication terminateWithStatus: _exitStatus]; } - (void)listFilesInArchive: (OFZIPArchive*)archive { OFEnumerator *enumerator = [[archive entries] objectEnumerator]; @@ -193,20 +194,22 @@ if ([outFileName hasPrefix: @"/"] || [outFileName containsString: @":"]) { #endif [of_stderr writeFormat: @"Refusing to extract %@!\n", fileName]; - [OFApplication terminateWithStatus: 1]; + _exitStatus = 1; + continue; } componentEnumerator = [[outFileName pathComponents] objectEnumerator]; while ((component = [componentEnumerator nextObject]) != nil) { if ([component isEqual: OF_PATH_PARENT_DIRECTORY]) { [of_stderr writeFormat: @"Refusing to extract %@!\n", fileName]; - [OFApplication terminateWithStatus: 1]; + _exitStatus = 1; + continue; } } if (_outputLevel > -1) [of_stdout writeFormat: @"Extracting %@...", fileName]; @@ -298,9 +301,9 @@ enumerator = [missing objectEnumerator]; while ((file = [enumerator nextObject]) != nil) [of_stderr writeFormat: @"File %@ is not in the archive!\n", file]; - [OFApplication terminateWithStatus: 1]; + _exitStatus = 1; } } @end