diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-22 18:39:06 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-22 18:39:06 +0000 |
commit | 742e47a0590983c901f7ecbde828402e7bb71ad0 (patch) | |
tree | e2cea1d7300a7fc7dc1860a205e91c963f5fff0f /gcc/genoutput.c | |
parent | 042d7fd970c762490125d0610096279756c71d44 (diff) | |
download | gcc-742e47a0590983c901f7ecbde828402e7bb71ad0.tar.gz |
* genoutput.c (process_template): Strip trailing whitespace in @
templates and issue a warning if there was any.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78270 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genoutput.c')
-rw-r--r-- | gcc/genoutput.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 9e27b276d0c..44bc412d488 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++; |