From c1771ce6bb26057c66f1eeeb3ca1fca96fff49b1 Mon Sep 17 00:00:00 2001 From: fedor Date: Fri, 15 Jun 2007 22:00:58 +0000 Subject: [PATCH] Skip .tab files when looking for zones. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25265 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSTimeZone.m | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) 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); }