@@ -180,11 +180,11 @@ parseNetStackArray(OFString *string) { if (![string hasPrefix: @"["] || ![string hasSuffix: @"]"]) return nil; - string = [string substringWithRange: OFRangeMake(1, string.length - 2)]; + string = [string substringWithRange: OFMakeRange(1, string.length - 2)]; return [string componentsSeparatedByString: @"|"]; } #endif @@ -266,11 +266,12 @@ return; } staticHosts = [OFMutableDictionary dictionary]; - while ((line = [file readLine]) != nil) { + while ((line = + [file readLineWithEncoding: [OFLocale encoding]]) != nil) { OFArray *components, *hosts; size_t pos; OFString *address; pos = [line rangeOfString: @"#"].location; @@ -284,11 +285,11 @@ if (components.count < 2) continue; address = components.firstObject; hosts = [components objectsInRange: - OFRangeMake(1, components.count - 1)]; + OFMakeRange(1, components.count - 1)]; for (OFString *host in hosts) { OFMutableArray *addresses = [staticHosts objectForKey: host]; @@ -366,11 +367,12 @@ } if (nameServers == nil) nameServers = [OFMutableArray array]; - while ((line = [file readLine]) != nil) { + while ((line = + [file readLineWithEncoding: [OFLocale encoding]]) != nil) { void *pool2 = objc_autoreleasePoolPush(); size_t pos; OFArray *components, *arguments; OFString *option; @@ -387,11 +389,11 @@ continue; } option = components.firstObject; arguments = [components objectsInRange: - OFRangeMake(1, components.count - 1)]; + OFMakeRange(1, components.count - 1)]; if ([option isEqual: @"nameserver"]) { if (arguments.count != 1) { objc_autoreleasePoolPop(pool2); continue; @@ -486,11 +488,11 @@ if (components.count < 2) continue; address = components.firstObject; hosts = [components objectsInRange: - OFRangeMake(1, components.count - 1)]; + OFMakeRange(1, components.count - 1)]; for (OFString *host in hosts) { OFMutableArray *addresses = [staticHosts objectForKey: host]; @@ -621,11 +623,12 @@ #if defined(OF_WINDOWS) # ifdef OF_HAVE_FILES OFWindowsRegistryKey *key = [[OFWindowsRegistryKey localMachineKey] openSubkeyAtPath: @"SYSTEM\\CurrentControlSet\\Services\\" @"Tcpip\\Parameters" - securityAndAccessRights: KEY_QUERY_VALUE]; + accessRights: KEY_QUERY_VALUE + options: 0]; path = [[[key stringForValueNamed: @"DataBasePath"] stringByAppendingPathComponent: @"hosts"] stringByExpandingWindowsEnvironmentStrings]; if (path != nil)