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

@ -230,7 +230,8 @@
id object;
string = [key description];
if ([string rangeOfCharacterFromSet: quotables].length > 0)
if ([string length] == 0
|| [string rangeOfCharacterFromSet: quotables].length > 0)
[desc appendFormat: @"%*s%s = ", level, "", [string quotedCString]];
else
[desc appendFormat: @"%*s%s = ", level, "", [string cStringNoCopy]];
@ -246,7 +247,8 @@
/* 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;\n", [string quotedCString]];
else
[desc appendFormat: @"%s;\n", [string cStringNoCopy]];

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

View file

@ -64,8 +64,8 @@
#define GDOMAP 1 /* 1 = Use name server. */
#define stringify_it(X) #X
#define make_gdomap_cmd(X) stringify_it(X) "/Tools/gdomap &"
#define make_gdomap_err(X) "check that " stringify_it(X) "/Tools/gdomap is running and owned by root."
#define make_gdomap_cmd(X) stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdomap &"
#define make_gdomap_err(X) "check that " stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdomap is running and owned by root."
#endif /* !__WIN32__ */
#include <string.h> /* for memset() and strchr() */