mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
improve check for valid zone file
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30540 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8b829c867a
commit
e9d1eae1ee
1 changed files with 12 additions and 3 deletions
|
@ -462,11 +462,21 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
|||
{
|
||||
if (data == nil)
|
||||
{
|
||||
NSString *fileName;
|
||||
NSString *fileName;
|
||||
BOOL isDir;
|
||||
|
||||
fileName = [NSTimeZoneClass _getTimeZoneFile: name];
|
||||
if (fileName == nil
|
||||
|| ![[NSFileManager defaultManager] fileExistsAtPath: fileName])
|
||||
|| ![[NSFileManager defaultManager] fileExistsAtPath: fileName
|
||||
isDirectory: &isDir] || YES == isDir)
|
||||
{
|
||||
data = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = [NSData dataWithContentsOfFile: fileName];
|
||||
}
|
||||
if (nil == data)
|
||||
#if defined(__MINGW__)
|
||||
{
|
||||
zone = [[GSWindowsTimeZone alloc] initWithName: name data: 0];
|
||||
|
@ -479,7 +489,6 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
|||
return nil;
|
||||
}
|
||||
#endif
|
||||
data = [NSData dataWithContentsOfFile: fileName];
|
||||
}
|
||||
#if defined(__MINGW__)
|
||||
if (!data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue