180 NSString *nsVerStr = [NSString stringWithFormat:@"%ld.%ld.%ld", |
180 NSString *nsVerStr = [NSString stringWithFormat:@"%ld.%ld.%ld", |
181 (long)osVer.majorVersion, (long)osVer.minorVersion, (long)osVer.patchVersion]; |
181 (long)osVer.majorVersion, (long)osVer.minorVersion, (long)osVer.patchVersion]; |
182 // Copy out the char* |
182 // Copy out the char* |
183 osVersionCStr = strdup([nsVerStr UTF8String]); |
183 osVersionCStr = strdup([nsVerStr UTF8String]); |
184 } |
184 } |
185 |
185 // Fallback if running on pre-10.9 Mac OS |
|
186 if (osVersionCStr == NULL) { |
|
187 NSDictionary *version = [NSDictionary dictionaryWithContentsOfFile : |
|
188 @"/System/Library/CoreServices/SystemVersion.plist"]; |
|
189 if (version != NULL) { |
|
190 NSString *nsVerStr = [version objectForKey : @"ProductVersion"]; |
|
191 if (nsVerStr != NULL) { |
|
192 osVersionCStr = strdup([nsVerStr UTF8String]); |
|
193 } |
|
194 } |
|
195 } |
186 if (osVersionCStr == NULL) { |
196 if (osVersionCStr == NULL) { |
187 osVersionCStr = strdup("Unknown"); |
197 osVersionCStr = strdup("Unknown"); |
188 } |
198 } |
189 sprops->os_version = osVersionCStr; |
199 sprops->os_version = osVersionCStr; |
190 } |
200 } |
191 |
201 |
192 |
202 |
193 static Boolean getProxyInfoForProtocol(CFDictionaryRef inDict, CFStringRef inEnabledKey, CFStringRef inHostKey, CFStringRef inPortKey, CFStringRef *outProxyHost, int *ioProxyPort) { |
203 static Boolean getProxyInfoForProtocol(CFDictionaryRef inDict, CFStringRef inEnabledKey, |
|
204 CFStringRef inHostKey, CFStringRef inPortKey, |
|
205 CFStringRef *outProxyHost, int *ioProxyPort) { |
194 /* See if the proxy is enabled. */ |
206 /* See if the proxy is enabled. */ |
195 CFNumberRef cf_enabled = CFDictionaryGetValue(inDict, inEnabledKey); |
207 CFNumberRef cf_enabled = CFDictionaryGetValue(inDict, inEnabledKey); |
196 if (cf_enabled == NULL) { |
208 if (cf_enabled == NULL) { |
197 return false; |
209 return false; |
198 } |
210 } |