aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@codesourcery.com>2000-02-21 20:17:41 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2000-02-21 20:17:41 +0000
commitabcabbbf3edb5782d34912bf573abc69ca6b8b90 (patch)
treee463b61a8f1726a9befece90fd15b4c8d4248793 /gcc/diagnostic.c
parentcb9a3ff816cd8da8efe463b4976652521fe9b396 (diff)
downloadgcc-abcabbbf3edb5782d34912bf573abc69ca6b8b90.zip
gcc-abcabbbf3edb5782d34912bf573abc69ca6b8b90.tar.gz
gcc-abcabbbf3edb5782d34912bf573abc69ca6b8b90.tar.bz2
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 <gdr@codesourcery.com> * 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
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 4aa084b..2af8e12 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. */