Minor fix parsing booleans

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14241 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-08-07 11:06:49 +00:00
parent b8e7170255
commit 0422591a90
3 changed files with 23 additions and 3 deletions

View file

@ -811,14 +811,19 @@ static NSString *pathForUser(NSString *user)
/**
* Looks up a value for a specified default using -objectForKey:
* and checks that it is a boolean. Returns NO if it is not.
* and returns its boolean representation.<br />
* Returns NO if it is not a boolean.<br />
* The text 'yes' or 'true' or any non zero numeric value is considered
* to be a boolean YES. Other string values are NO.
*/
- (BOOL) boolForKey: (NSString*)defaultName
{
id obj = [self stringForKey: defaultName];
if (obj != nil)
return [obj boolValue];
{
return [obj boolValue];
}
return NO;
}