From: Matt Birkholz Date: Wed, 17 Jun 2015 01:56:30 +0000 (-0700) Subject: debug.c (print_string): Summarize long strings. X-Git-Tag: mit-scheme-pucked-9.2.12~376^2~67 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=76b9efd97f99674cc398274c518287991d9a63c9;p=mit-scheme.git debug.c (print_string): Summarize long strings. --- 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, "\""); }