2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-24 13:11:44 +08:00

collect2.c (dump_file): If a demangled symbol is followed by a space...

* collect2.c (dump_file): If a demangled symbol is followed by a
	space, make sure we output at least one space.

From-SVN: r130243
This commit is contained in:
Ian Lance Taylor 2007-11-16 22:11:29 +00:00 committed by Ian Lance Taylor
parent 5abe968588
commit fda4ba9996
2 changed files with 17 additions and 2 deletions

@ -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

@ -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);
}