mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Check for array with no objects
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15032 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3ddbbe0c7c
commit
b1d1b629bc
2 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2002-11-20 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSBundle.m (+preferredLocalizationsFromArray:forPreferences:):
|
||||||
|
Check for array with no objects.
|
||||||
|
([NSBundle -localizedInfoDictionary]): Idem.
|
||||||
|
|
||||||
2002-11-20 Richard Frith-Macdonald <rfm@gnu.org>
|
2002-11-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/Additions/Unicode.m: Work around bug in the redhat 8 iconv
|
* Source/Additions/Unicode.m: Work around bug in the redhat 8 iconv
|
||||||
|
|
|
@ -1319,18 +1319,21 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||||
[array addObject: locale];
|
[array addObject: locale];
|
||||||
}
|
}
|
||||||
/* I guess this is arbitrary if we can't find a match? */
|
/* I guess this is arbitrary if we can't find a match? */
|
||||||
if ([array count] == 0)
|
if ([array count] == 0 && [localizationsArray count] > 0)
|
||||||
[array addObject: [localizationsArray objectAtIndex: 0]];
|
[array addObject: [localizationsArray objectAtIndex: 0]];
|
||||||
return [array makeImmutableCopyOnFail: NO];
|
return [array makeImmutableCopyOnFail: NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDictionary *)localizedInfoDictionary
|
- (NSDictionary *)localizedInfoDictionary
|
||||||
{
|
{
|
||||||
NSString* path;
|
NSString *path;
|
||||||
NSString* locale;
|
NSArray *locales;
|
||||||
|
NSString *locale = nil;
|
||||||
NSDictionary *dict = nil;
|
NSDictionary *dict = nil;
|
||||||
|
|
||||||
locale = [[self preferredLocalizations] objectAtIndex: 0];
|
locales = [self preferredLocalizations];
|
||||||
|
if ([locales count] > 0)
|
||||||
|
locale = [locales objectAtIndex: 0];
|
||||||
path = [self pathForResource: @"Info-gnustep"
|
path = [self pathForResource: @"Info-gnustep"
|
||||||
ofType: @"plist"
|
ofType: @"plist"
|
||||||
inDirectory: nil
|
inDirectory: nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue