diff --git a/ChangeLog b/ChangeLog index 39fcefab6..d526a2923 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-15 Adam Fedor + + * Source/NSTimeZone.m ([NSTimeZone +timeZoneArray]): Skip .tab + files when looking for zones. + 2007-06-14 Richard Frith-Macdonald * Source/NSNumber.m: Implement ([isEqualToValue:]) diff --git a/Source/NSTimeZone.m b/Source/NSTimeZone.m index dfc1b9700..575ec5980 100644 --- a/Source/NSTimeZone.m +++ b/Source/NSTimeZone.m @@ -1593,12 +1593,11 @@ static NSMapTable *absolutes = 0; { NSTimeZone *zone = nil; BOOL isDir; - - // FIXME: check file validity. path = [zonedir stringByAppendingPathComponent: name]; if ([mgr fileExistsAtPath: path isDirectory: &isDir] - && isDir == NO) + && isDir == NO + && [[path pathExtension] isEqual: @"tab"] == NO) { zone = [zoneDictionary objectForKey: name]; if (zone == nil) @@ -1606,6 +1605,10 @@ static NSMapTable *absolutes = 0; NSData *data; data = [NSData dataWithContentsOfFile: path]; + /* We should really make sure this is a real + zone file and not something extra that happens + to be in this directory, but initWithName:data: + will do this anyway and log a message if not. */ zone = [[self alloc] initWithName: name data: data]; AUTORELEASE(zone); }