Skip to content

Commit

Permalink
Removing GNU-style ?: operators. Thanks for the report, Uli.
Browse files Browse the repository at this point in the history
  • Loading branch information
andymatuschak committed Dec 10, 2009
1 parent b546304 commit a032358
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SUAppcast.m
Expand Up @@ -223,7 +223,7 @@ - (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes
while ((node = [nodeEnum nextObject]))
{
lang = [[node attributeForName:@"xml:lang"] stringValue];
[languages addObject:(lang ?: @"")];
[languages addObject:(lang ? lang : @"")];
}
lang = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0];
i = [languages indexOfObject:([languages containsObject:lang] ? lang : @"")];
Expand Down
2 changes: 1 addition & 1 deletion SUHost.m
Expand Up @@ -195,7 +195,7 @@ - (void)setBool:(BOOL)value forUserDefaultsKey:(NSString *)defaultName
}

- (id)objectForKey:(NSString *)key {
return [self objectForUserDefaultsKey:key] ?: [self objectForInfoDictionaryKey:key];
return [self objectForUserDefaultsKey:key] ? [self objectForUserDefaultsKey:key] : [self objectForInfoDictionaryKey:key];
}

- (BOOL)boolForKey:(NSString *)key {
Expand Down
3 changes: 2 additions & 1 deletion SUUpdater.m
Expand Up @@ -313,7 +313,8 @@ - (NSString *)userAgentString
if (customUserAgentString)
return customUserAgentString;

NSString *userAgent = [NSString stringWithFormat:@"%@/%@ Sparkle/%@", [host name], [host displayVersion], [SPARKLE_BUNDLE objectForInfoDictionaryKey:@"CFBundleVersion"] ?: nil];
NSString *version = [SPARKLE_BUNDLE objectForInfoDictionaryKey:@"CFBundleVersion"];
NSString *userAgent = [NSString stringWithFormat:@"%@/%@ Sparkle/%@", [host name], [host displayVersion], version ? version : @"?"];
NSData *cleanedAgent = [userAgent dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
return [[[NSString alloc] initWithData:cleanedAgent encoding:NSASCIIStringEncoding] autorelease];
}
Expand Down

0 comments on commit a032358

Please sign in to comment.