Patch from Richard.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2623 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 1997-11-07 18:46:30 +00:00
parent 3dd1e6b669
commit 4fbe10eb9e
5 changed files with 34 additions and 14 deletions

View file

@ -389,6 +389,11 @@ static Class NSMutableArray_concrete_class;
}
- (NSString*) description
{
return [self descriptionWithIndent: 0];
}
- (NSString*) descriptionWithIndent: (int)level
{
id string;
id desc;
@ -415,7 +420,8 @@ static Class NSMutableArray_concrete_class;
/* This should be a string or number, so decide if we need to
quote it */
string = [object description];
if ([string rangeOfCharacterFromSet: quotables].length > 0)
if ([string length] == 0
|| [string rangeOfCharacterFromSet: quotables].length > 0)
[desc appendFormat: @"%s", [string quotedCString]];
else
[desc appendString: string];
@ -437,7 +443,8 @@ static Class NSMutableArray_concrete_class;
/* This should be a string or number, so decide if we need to
quote it */
string = [object description];
if ([string rangeOfCharacterFromSet: quotables].length > 0)
if ([string length] == 0
|| [string rangeOfCharacterFromSet: quotables].length > 0)
[desc appendString: [NSString stringWithCString:
[string quotedCString]]];
else
@ -448,11 +455,6 @@ static Class NSMutableArray_concrete_class;
return desc;
}
- (NSString*) descriptionWithIndent: (unsigned)level
{
return [self description];
}
/* The NSCopying Protocol */
- (id) copy