From abcabbbf3edb5782d34912bf573abc69ca6b8b90 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Mon, 21 Feb 2000 20:17:41 +0000 Subject: [PATCH] diagnostic.c (init_output_buffer): Make it possible to output at least 32 characters if we're given a too long prefix. 2000-02-21 Gabriel Dos Reis * diagnostic.c (init_output_buffer): Make it possible to output at least 32 characters if we're given a too long prefix. From-SVN: r32091 --- gcc/ChangeLog | 5 +++++ gcc/diagnostic.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c3f8de6ba29..b194fe902fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-02-21 Gabriel Dos Reis + + * diagnostic.c (init_output_buffer): Make it possible to output at + least 32 characters if we're given a too long prefix. + 2000-02-20 Mark Mitchell * varasm.c (initializer_constant_valid_p): Call diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 4aa084b379b..2af8e125fc7 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -152,10 +152,17 @@ init_output_buffer (buffer, prefix, max_length) char *prefix; int max_length; { + int prefix_length = strlen (prefix); + obstack_init (&buffer->obstack); buffer->prefix = prefix; buffer->line_length = 0; - buffer->max_length = max_length; + /* If the prefix is ridiculously too long, output at least + 32 characters. */ + if (max_length - prefix_length < 32) + buffer->max_length = max_length + 32; + else + buffer->max_length = max_length; } /* Return BUFFER's prefix. */ -- 2.30.2