Skip to content

Commit

Permalink
More fixes for Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Feb 7, 2025
1 parent df0b0d8 commit ef6aa4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions XADArchiveParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ +(XADArchiveParser *)archiveParserForFileURL:(NSURL *)filename
{
// An empty array means scanning failed. Set a flag to
// warn the caller, and fall through to single-file mode.
props[XADVolumeScanningFailedKey] = @YES;
[props setValue:[NSNumber numberWithBool:YES] forKey:XADVolumeScanningFailedKey];
}
}
}
Expand All @@ -571,7 +571,7 @@ +(XADArchiveParser *)archiveParserForFileURL:(NSURL *)filename
parser.resourceFork = fork;
parser.filename = filename.path;

props[XADVolumesKey] = @[filename.path];
props[XADVolumesKey] = [NSArray arrayWithObject:filename.path];
[parser addPropertiesFromDictionary:props];

return [parser autorelease];
Expand Down Expand Up @@ -1067,7 +1067,7 @@ + (void)throwExceptionFromError:(NSError *)error
return;
}
NSMutableDictionary *exceptionUserInfo = [error.userInfo mutableCopy];
exceptionUserInfo[@"XADError"] = @((XADError)error.code);
[exceptionUserInfo setValue:[NSNumber numberWithInt:(XADError)error.code] forKey:@"XADError"];
[[[NSException alloc] initWithName:XADExceptionName reason:[XADException describeXADError:(XADError)error.code]
userInfo:exceptionUserInfo] raise];

Expand Down Expand Up @@ -1550,7 +1550,7 @@ +(XADArchiveParser *)archiveParserForFileURL:(NSURL *)filename error:(NSError **
return nil;
}
if (errorptr) {
*errorptr = [NSError errorWithDomain:XADErrorDomain code:XADErrorNotSupported userInfo:@{NSURLErrorKey: filename}];
*errorptr = [NSError errorWithDomain:XADErrorDomain code:XADErrorNotSupported userInfo:[NSDictionary dictionaryWithObjectsAndKeys:filename, NSURLErrorKey, nil]];
}
return nil;
}
Expand All @@ -1569,7 +1569,7 @@ +(XADArchiveParser *)archiveParserForPath:(NSString *)filename nserror:(NSError
return nil;
}
if (errorptr) {
*errorptr = [NSError errorWithDomain:XADErrorDomain code:XADErrorNotSupported userInfo:@{NSFilePathErrorKey: filename}];
*errorptr = [NSError errorWithDomain:XADErrorDomain code:XADErrorNotSupported userInfo:[NSDictionary dictionaryWithObjectsAndKeys:filename, NSFilePathErrorKey, nil]];
}
return nil;
}
Expand Down
2 changes: 1 addition & 1 deletion XADException.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ +(NSError*)parseExceptionReturningNSError:(nonnull id)exception
{
NSException *e=exception;
NSString *name=[e name];
NSMutableDictionary *usrInfo = [NSMutableDictionary dictionaryWithDictionary:e.userInfo ?: @{}];
NSMutableDictionary *usrInfo = [NSMutableDictionary dictionaryWithDictionary:e.userInfo ?: [NSDictionary dictionary]];
usrInfo[XADExceptionReasonKey] = e.reason;
if ([name isEqualToString:XADExceptionName]) {
XADError errVal = [[e userInfo][@"XADError"] intValue];
Expand Down
2 changes: 1 addition & 1 deletion XADSimpleUnarchiver.m
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ -(BOOL)parseWithError:(NSError**)error
{
if(entries.count) {
if (error) {
*error = [NSError errorWithDomain:XADErrorDomain code:XADErrorBadParameters userInfo:@{NSLocalizedDescriptionKey: @"You can not call parseAndUnarchive twice", NSDebugDescriptionErrorKey: @"You can not call parseAndUnarchive twice"}];
*error = [NSError errorWithDomain:XADErrorDomain code:XADErrorBadParameters userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"You can not call parseAndUnarchive twice", NSLocalizedDescriptionKey, @"You can not call parseAndUnarchive twice", NSDebugDescriptionErrorKey, nil]];
}

return NO;
Expand Down

0 comments on commit ef6aa4d

Please sign in to comment.