From: Jakub Jelinek Date: Sun, 22 Feb 2004 18:39:06 +0000 (+0100) Subject: genoutput.c (process_template): Strip trailing whitespace in @ templates and issue... X-Git-Tag: releases/gcc-4.0.0~9934 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4112be4ad381448094bc3c5d7c3c3b1ed8c48615;p=thirdparty%2Fgcc.git genoutput.c (process_template): Strip trailing whitespace in @ templates and issue a warning if there was any. * genoutput.c (process_template): Strip trailing whitespace in @ templates and issue a warning if there was any. From-SVN: r78270 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2fb84649bacc..8377d279989e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-02-22 Jakub Jelinek + + * genoutput.c (process_template): Strip trailing whitespace in @ + templates and issue a warning if there was any. + 2004-02-21 Christopher Faylor * config.gcc (i[34567]86-*-pe|i[34567]86-*-cygwin*): Specify extra host diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 9e27b276d0cc..44bc412d4884 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -682,11 +682,22 @@ process_template (struct data *d, const char *template) for (i = 0, cp = &template[1]; *cp; ) { + const char *ep, *sp; + while (ISSPACE (*cp)) cp++; printf (" \""); - while (!IS_VSPACE (*cp) && *cp != '\0') + + for (ep = sp = cp; !IS_VSPACE (*ep) && *ep != '\0'; ++ep) + if (!ISSPACE (*ep)) + sp = ep + 1; + + if (sp != ep) + message_with_line (d->lineno, + "trailing whitespace in output template"); + + while (cp < sp) { putchar (*cp); cp++;