Differences From Artifact [179fc83ef4]:
- File
src/OFDNSResolverSettings.m
— part of check-in
[ce2b268163]
at
2023-04-17 11:56:02
on branch trunk
— Always make DNS names lowercase
This avoids problems when comparing them. (user: js, size: 17103) [annotate] [blame] [check-ins using] [more...]
To Artifact [5041325a54]:
- File
src/OFDNSResolverSettings.m
— part of check-in
[cb260c0ef2]
at
2023-07-30 23:48:02
on branch trunk
— OFDNSResolverSettings: Allow ; for comments
AmiTCP seems to use ; instead of # for comments in the hosts file. (user: js, size: 17223) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | #if defined(OF_HAVE_FILES) && !defined(OF_MORPHOS) && !defined(OF_NINTENDO_3DS) - (void)parseHosts: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFCharacterSet *whitespaceCharacterSet = [OFCharacterSet whitespaceCharacterSet]; OFMutableDictionary *staticHosts; OFFile *file; OFString *line; @try { file = [OFFile fileWithPath: path mode: @"r"]; } @catch (OFOpenItemFailedException *e) { objc_autoreleasePoolPop(pool); return; } staticHosts = [OFMutableDictionary dictionary]; while ((line = [file readLineWithEncoding: [OFLocale encoding]]) != nil) { OFArray *components, *hosts; size_t pos; OFString *address; | > > | | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | #if defined(OF_HAVE_FILES) && !defined(OF_MORPHOS) && !defined(OF_NINTENDO_3DS) - (void)parseHosts: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFCharacterSet *whitespaceCharacterSet = [OFCharacterSet whitespaceCharacterSet]; OFCharacterSet *commentCharacterSet = [OFCharacterSet characterSetWithCharactersInString: @"#;"]; OFMutableDictionary *staticHosts; OFFile *file; OFString *line; @try { file = [OFFile fileWithPath: path mode: @"r"]; } @catch (OFOpenItemFailedException *e) { objc_autoreleasePoolPop(pool); return; } staticHosts = [OFMutableDictionary dictionary]; while ((line = [file readLineWithEncoding: [OFLocale encoding]]) != nil) { OFArray *components, *hosts; size_t pos; OFString *address; pos = [line indexOfCharacterFromSet: commentCharacterSet]; if (pos != OFNotFound) line = [line substringToIndex: pos]; components = [line componentsSeparatedByCharactersInSet: whitespaceCharacterSet options: OFStringSkipEmptyComponents]; |
︙ | ︙ |