From 88d9f644681665fe656fda7cac55e2ad57ddcc4c Mon Sep 17 00:00:00 2001 From: handa Date: Wed, 2 Aug 2006 11:08:10 +0000 Subject: [PATCH] (mdebug_dump_mtext): If not fullp, dump just text. --- src/mtext.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mtext.c b/src/mtext.c index e72dfa6..1387f3c 100644 --- a/src/mtext.c +++ b/src/mtext.c @@ -3596,20 +3596,11 @@ mtext_uppercase (MText *mt) MText * mdebug_dump_mtext (MText *mt, int indent, int fullp) { - char *prefix = (char *) alloca (indent + 1); int i; - unsigned char *p; - - memset (prefix, 32, indent); - prefix[indent] = 0; - fprintf (stderr, - "(mtext (size %d %d %d) (cache %d %d)", - mt->nchars, mt->nbytes, mt->allocated, - mt->cache_char_pos, mt->cache_byte_pos); if (! fullp) { - fprintf (stderr, " \""); + fprintf (stderr, "\""); for (i = 0; i < mt->nchars; i++) { int c = mtext_ref_char (mt, i); @@ -3622,9 +3613,22 @@ mdebug_dump_mtext (MText *mt, int indent, int fullp) fprintf (stderr, "\\x%02X", c); } fprintf (stderr, "\""); + return mt; } - else if (mt->nchars > 0) + + fprintf (stderr, + "(mtext (size %d %d %d) (cache %d %d)", + mt->nchars, mt->nbytes, mt->allocated, + mt->cache_char_pos, mt->cache_byte_pos); + + if (mt->nchars > 0) { + char *prefix = (char *) alloca (indent + 1); + unsigned char *p; + + memset (prefix, 32, indent); + prefix[indent] = 0; + fprintf (stderr, "\n%s (bytes \"", prefix); for (i = 0; i < mt->nbytes; i++) fprintf (stderr, "\\x%02x", mt->data[i]); -- 1.7.10.4