This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH to diagnostic.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH to diagnostic.c
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 21 Feb 2000 21:20:55 +0100
- Organization: CodeSourcery, LLC
The patch attached makes it possible to output at least 32 characters
in automatic line-wrapping mode.
-- Gaby
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.
Index: diagnostic.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/diagnostic.c,v
retrieving revision 1.6
diff -p -r1.6 diagnostic.c
*** diagnostic.c 2000/02/06 03:40:45 1.6
--- diagnostic.c 2000/02/21 20:14:21
*************** init_output_buffer (buffer, prefix, max_
*** 152,161 ****
char *prefix;
int max_length;
{
obstack_init (&buffer->obstack);
buffer->prefix = prefix;
buffer->line_length = 0;
! buffer->max_length = max_length;
}
/* Return BUFFER's prefix. */
--- 152,168 ----
char *prefix;
int max_length;
{
+ int prefix_length = strlen (prefix);
+
obstack_init (&buffer->obstack);
buffer->prefix = prefix;
buffer->line_length = 0;
! /* 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. */