From 76b9efd97f99674cc398274c518287991d9a63c9 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 16 Jun 2015 18:56:30 -0700 Subject: [PATCH] debug.c (print_string): Summarize long strings. --- src/microcode/debug.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/microcode/debug.c b/src/microcode/debug.c index 5e7a36d4a..7c31f9a09 100644 --- a/src/microcode/debug.c +++ b/src/microcode/debug.c @@ -189,15 +189,16 @@ Print_Return (const char * String) static void print_string (outf_channel stream, SCHEME_OBJECT string) { - long length; + long length, long_enough; long i; char * next; char this; outf (stream, "\""); length = (STRING_LENGTH (string)); + long_enough = (length < 100 ? length : 90); next = (STRING_POINTER (string)); - for (i = 0; (i < length); i += 1) + for (i = 0; (i < long_enough); i += 1) { this = (*next++); switch (this) @@ -225,6 +226,8 @@ print_string (outf_channel stream, SCHEME_OBJECT string) break; } } + if (length != long_enough) + outf (stream, "...[%ld total chars]", length); outf (stream, "\""); } -- 2.25.1