This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH to diagnostic.c



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]