Index: utils/ofzip/OFZIP.m ================================================================== --- utils/ofzip/OFZIP.m +++ utils/ofzip/OFZIP.m @@ -295,10 +295,11 @@ entryEnumerator = [[archive entries] objectEnumerator]; while ((entry = [entryEnumerator nextObject]) != nil) { void *pool = objc_autoreleasePoolPush(); OFString *fileName = [entry fileName]; OFString *outFileName = [fileName stringByStandardizingPath]; + OFArray OF_GENERIC(OFString*) *pathComponents; OFEnumerator OF_GENERIC(OFString*) *componentEnumerator; OFString *component, *directory; OFStream *stream; OFFile *output; char buffer[BUFFER_SIZE]; @@ -316,24 +317,27 @@ if ([outFileName hasPrefix: @"/"] || [outFileName containsString: @":"]) { #endif [of_stderr writeFormat: @"Refusing to extract %@!\n", fileName]; + _exitStatus = 1; - continue; + goto outer_loop_end; } - componentEnumerator = - [[outFileName pathComponents] objectEnumerator]; + pathComponents = [outFileName pathComponents]; + componentEnumerator = [pathComponents objectEnumerator]; while ((component = [componentEnumerator nextObject]) != nil) { if ([component isEqual: OF_PATH_PARENT_DIRECTORY]) { [of_stderr writeFormat: @"Refusing to extract %@!\n", fileName]; + _exitStatus = 1; - continue; + goto outer_loop_end; } } + outFileName = [OFString pathWithComponents: pathComponents]; if (_outputLevel >= 0) [of_stdout writeFormat: @"Extracting %@...", fileName]; if ([fileName hasSuffix: @"/"]) { @@ -342,11 +346,11 @@ setPermissions(outFileName, entry); if (_outputLevel >= 0) [of_stdout writeLine: @" done"]; - continue; + goto outer_loop_end; } directory = [outFileName stringByDeletingLastPathComponent]; if (![OFFile directoryExistsAtPath: directory]) [OFFile createDirectoryAtPath: directory @@ -356,11 +360,12 @@ OFString *line; if (_override == -1) { if (_outputLevel >= 0) [of_stdout writeLine: @" skipped"]; - continue; + + goto outer_loop_end; } do { [of_stderr writeFormat: @"\rOverride %@? [ynAN?] ", fileName]; @@ -382,11 +387,12 @@ _override = -1; if ([line isEqual: @"n"] || [line isEqual: @"N"]) { [of_stdout writeFormat: @"Skipping %@...\n", fileName]; - continue; + + goto outer_loop_end; } [of_stdout writeFormat: @"Extracting %@...", fileName]; }