diff --git a/Sparkle/SUBinaryDeltaCommon.m b/Sparkle/SUBinaryDeltaCommon.m index be3966ce..de247ee5 100644 --- a/Sparkle/SUBinaryDeltaCommon.m +++ b/Sparkle/SUBinaryDeltaCommon.m @@ -231,12 +231,12 @@ BOOL modifyPermissions(NSString *path, mode_t desiredPermissions) if (!attributes) { return NO; } - NSNumber *permissions = attributes[NSFilePosixPermissions]; + NSNumber *permissions = [attributes objectForKey:NSFilePosixPermissions]; if (!permissions) { return NO; } mode_t newMode = ([permissions unsignedShortValue] & ~PERMISSION_FLAGS) | desiredPermissions; - int (*changeModeFunc)(const char *, mode_t) = [attributes[NSFileType] isEqualToString:NSFileTypeSymbolicLink] ? lchmod : chmod; + int (*changeModeFunc)(const char *, mode_t) = [[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeSymbolicLink] ? lchmod : chmod; if (changeModeFunc([path fileSystemRepresentation], newMode) != 0) { return NO; } diff --git a/Sparkle/SUFileManager.m b/Sparkle/SUFileManager.m index 725e78ac..d0fc3b00 100644 --- a/Sparkle/SUFileManager.m +++ b/Sparkle/SUFileManager.m @@ -151,7 +151,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { } if (isDirectory != NULL) { - *isDirectory = [attributes[NSFileType] isEqualToString:NSFileTypeDirectory]; + *isDirectory = [[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeDirectory]; } return YES; @@ -595,7 +595,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return NO; } - NSNumber *ownerID = matchFileAttributes[NSFileOwnerAccountID]; + NSNumber *ownerID = [matchFileAttributes objectForKey:NSFileOwnerAccountID]; if (ownerID == nil) { // shouldn't be possible to error here, but just in case if (error != NULL) { @@ -604,7 +604,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return NO; } - NSNumber *groupID = matchFileAttributes[NSFileGroupOwnerAccountID]; + NSNumber *groupID = [matchFileAttributes objectForKey:NSFileGroupOwnerAccountID]; if (groupID == nil) { // shouldn't be possible to error here, but just in case if (error != NULL) { @@ -613,8 +613,8 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return NO; } - NSNumber *targetOwnerID = targetFileAttributes[NSFileOwnerAccountID]; - NSNumber *targetGroupID = targetFileAttributes[NSFileGroupOwnerAccountID]; + NSNumber *targetOwnerID = [targetFileAttributes objectForKey:NSFileOwnerAccountID]; + NSNumber *targetGroupID = [targetFileAttributes objectForKey:NSFileGroupOwnerAccountID]; if ((targetOwnerID != nil && [ownerID isEqualToNumber:targetOwnerID]) && (targetGroupID != nil && [groupID isEqualToNumber:targetGroupID])) { // Assume they're the same even if we don't check every file recursively