]> gcc.gnu.org Git - gcc.git/commitdiff
genoutput.c (process_template): Strip trailing whitespace in @ templates and issue...
authorJakub Jelinek <jakub@redhat.com>
Sun, 22 Feb 2004 18:39:06 +0000 (19:39 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 22 Feb 2004 18:39:06 +0000 (19:39 +0100)
* genoutput.c (process_template): Strip trailing whitespace in @
templates and issue a warning if there was any.

From-SVN: r78270

gcc/ChangeLog
gcc/genoutput.c

index 2fb84649baccc7f0b3c0f8b52a9cdd5cc21a26a8..8377d279989eac43ef9977bced3b3aa18f38b250 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-22  Jakub Jelinek  <jakub@redhat.com>
+
+       * genoutput.c (process_template): Strip trailing whitespace in @
+       templates and issue a warning if there was any.
+
 2004-02-21  Christopher Faylor  <cgf@redhat.com>
 
        * config.gcc (i[34567]86-*-pe|i[34567]86-*-cygwin*): Specify extra host
index 9e27b276d0cc9376461f1dd8fefd33a3e297ec86..44bc412d48840ad8094d8a516add5857cbaae653 100644 (file)
@@ -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++;
This page took 0.071812 seconds and 5 git commands to generate.