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

@ -2182,10 +2182,21 @@ handle_printf_atsign (FILE *stream,
// xxx Sould we use NSScanner here ?
/**
* If the string consists of the words 'true' or 'yes' (case insensitive)
* or begins with a non-zero numeric value, return YES, otherwise return
* NO.
*/
- (BOOL) boolValue
{
if ([self caseInsensitiveCompare: @"YES"] == NSOrderedSame)
return YES;
{
return YES;
}
if ([self caseInsensitiveCompare: @"true"] == NSOrderedSame)
{
return YES;
}
return [self intValue] != 0 ? YES : NO;
}