Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions XADUnarchiver.m
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,13 @@ -(XADError)_extractFileEntryWithDictionary:(NSDictionary *)dict as:(NSString *)d

[fh close];

// Remove the output file on any failure. This includes XADBreakError, which in
// most cases produces a partial file (cancellation is checked per 256KB chunk).
if(err!=XADNoError)
{
[XADPlatform removeItemAtPath:destpath];
}
Comment thread
alek-prykhodko marked this conversation as resolved.

return err;
}

Expand Down Expand Up @@ -498,20 +505,30 @@ -(XADError)_extractResourceForkEntryWithDictionary:(NSDictionary *)dict asAppleD

NSDictionary *extattrs=[parser extendedAttributesForDictionary:dict];

XADError error=XADNoError;
@try
{
// TODO: Should this function handle exceptions itself?
[XADAppleDouble writeAppleDoubleHeaderToHandle:fh resourceForkSize:(int)ressize
extendedAttributes:extattrs];
[XADAppleDouble writeAppleDoubleHeaderToHandle:fh
resourceForkSize:(int)ressize
extendedAttributes:extattrs];
if(ressize)
{
error=[self runExtractorWithDictionary:dict outputHandle:fh];
}
} @catch(id e) {
error=[XADException parseException:e];
}
@catch(id e) { return [XADException parseException:e]; }

// Write resource fork.
XADError error=XADNoError;
if(ressize) error=[self runExtractorWithDictionary:dict outputHandle:fh];

[fh close];

// Remove the output file on any failure. This includes XADBreakError, which in
// most cases produces a partial file (cancellation is checked per 256KB chunk).
if(error!=XADNoError)
{
[XADPlatform removeItemAtPath:destpath];
}
Comment thread
alek-prykhodko marked this conversation as resolved.

return error;
}

Expand Down
Loading