diagnostic.c (init_output_buffer): Make it possible to output at least 32 characters...
authorGabriel Dos Reis <gdr@codesourcery.com>
Mon, 21 Feb 2000 20:17:41 +0000 (20:17 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Mon, 21 Feb 2000 20:17:41 +0000 (20:17 +0000)
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

gcc/ChangeLog
gcc/diagnostic.c

index c3f8de6ba29c5f0e43dd251b072f67fb619589f6..b194fe902fefe68d8140cb69be7521879d4edc9b 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2000-02-20  Mark Mitchell  <mark@codesourcery.com>
 
        * varasm.c (initializer_constant_valid_p): Call
index 4aa084b379bf043540f2667cc3cd3c03a9225fd5..2af8e125fc7f6903b93efe42986a98e9781eb3d0 100644 (file)
@@ -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.  */