From a7aa62d7db8969761faa527781a933b249ef9e6f Mon Sep 17 00:00:00 2001 From: mccallum Date: Fri, 19 Apr 1996 23:16:59 +0000 Subject: [PATCH] ([TextCStream -encodeValueOfCType:at:withName:]): If name is nil or zero-length, make it "Anonymous". git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1485 72102866-910b-0410-8b05-ffd578937521 --- Source/TextCStream.m | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Source/TextCStream.m b/Source/TextCStream.m index ad9520388..93f71988f 100644 --- a/Source/TextCStream.m +++ b/Source/TextCStream.m @@ -58,8 +58,8 @@ static BOOL debug_textcoder = NO; assert(*type != '^'); assert(*type != ':'); - if (!name) - name = @""; + if (!name || [name length] == 0) + name = @"Anonymous"; switch (*type) { case _C_LNG: @@ -164,8 +164,15 @@ static BOOL debug_textcoder = NO; #define DECODER_FORMAT(TYPE, CONVERSION) \ @" <%a[^>]> (" ATXSTR(TYPE) @") = %" ATXSTR(CONVERSION) @" \n" -#define DECODE_ERROR(TYPE) [NSException raise: NSGenericException \ -format: @"bad format decoding " ATXSTR(TYPE)] +#define DECODE_ERROR(TYPE) \ +{ \ + id line = [stream readLine]; \ + [NSException raise: NSGenericException \ + format: @"bad format decoding " ATXSTR(TYPE) @".\n" \ + @"Looking at %s\n.", \ + [line cStringNoCopy]]; \ +} + #define DECODE_DEBUG(TYPE, CONVERSION) \ if (debug_textcoder) \