collect2.c (dump_file): If a demangled symbol is followed by a space...
authorIan Lance Taylor <iant@google.com>
Fri, 16 Nov 2007 22:11:29 +0000 (22:11 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 16 Nov 2007 22:11:29 +0000 (22:11 +0000)
* collect2.c (dump_file): If a demangled symbol is followed by a
space, make sure we output at least one space.

From-SVN: r130243

gcc/ChangeLog
gcc/collect2.c

index 7bd076309e6150674f1b8b29ff8d44de821ce0fc..2bef81feb0d560abfcae7218b0658b20f68c5e08 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-16  Ian Lance Taylor  <iant@google.com>
+
+       * collect2.c (dump_file): If a demangled symbol is followed by a
+       space, make sure we output at least one space.
+
 2007-11-16  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/34030
index 9d5e5c2ae107f475e73aedac3971c564b49248b6..a673f256c3d99649f3f16ef94e335d53f1e087d4 100644 (file)
@@ -487,8 +487,18 @@ dump_file (const char *name, FILE *to)
              diff = strlen (word) - strlen (result);
              while (diff > 0 && c == ' ')
                --diff, putc (' ', to);
-             while (diff < 0 && c == ' ')
-               ++diff, c = getc (stream);
+             if (diff < 0 && c == ' ')
+               {
+                 while (diff < 0 && c == ' ')
+                   ++diff, c = getc (stream);
+                 if (!ISSPACE (c))
+                   {
+                     /* Make sure we output at least one space, or
+                        the demangled symbol name will run into
+                        whatever text follows.  */
+                     putc (' ', to);
+                   }
+               }
 
              free (result);
            }