make -description more informative

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28578 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-08-31 07:08:39 +00:00
parent 019f6b1da6
commit 8f97c8ffc9
3 changed files with 19 additions and 14 deletions

View file

@ -1335,9 +1335,12 @@ typedef struct {
- (NSString*) description
{
NSString *desc;
NSArray *names;
desc = [NSString stringWithFormat: @"<NSMessagePort %p with name %s>",
self, [name bytes]];
names = [[NSMessagePortNameServer sharedInstance] namesForPort: self];
desc = [NSString stringWithFormat:
@"NSMessagePort %p %@ with file name %s",
self, ([names count] == 0) ? (id)@"<un-named>" : (id)names, [name bytes]];
return desc;
}