PATCH to diagnostic.c

Gabriel Dos Reis gdr@codesourcery.com
Mon Feb 21 12:20:00 GMT 2000


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.  */



More information about the Gcc-patches mailing list