Fix line number counting.
authorPer Bothner <bothner@gcc.gnu.org>
Mon, 11 Apr 1994 21:26:48 +0000 (14:26 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Mon, 11 Apr 1994 21:26:48 +0000 (14:26 -0700)
From-SVN: r7036

gcc/scan.c

index 17e9898497f155cbc5532da0c004267c68631926..b62899081916f57e02b35b2b532df494403b87c3 100644 (file)
@@ -220,7 +220,7 @@ get_token (fp, s)
       c = get_token (fp, s);
       if (c == INT_TOKEN)
        {
-         source_lineno = atoi (s->base);
+         source_lineno = atoi (s->base) - 1; /* '\n' will add 1 */
          get_token (fp, &source_filename);
        }
       for (;;)
@@ -229,7 +229,11 @@ get_token (fp, s)
          if (c == EOF)
            return EOF;
          if (c == '\n')
+           {
+           source_lineno++;
+           lineno++;
            goto retry;
+           }
        }
     }
   if (c == EOF)