From fda4ba9996a0d43cd2bce450a7ad290a91dbf7bc Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 16 Nov 2007 22:11:29 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/collect2.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bd076309e6..2bef81feb0d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-11-16 Ian Lance Taylor + + * 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 PR middle-end/34030 diff --git a/gcc/collect2.c b/gcc/collect2.c index 9d5e5c2ae10..a673f256c3d 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -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); } -- 2.30.2