aboutsummaryrefslogtreecommitdiff
path: root/gcc/scan.c
diff options
context:
space:
mode:
authorbothner <>1994-04-11 20:26:48 +0000
committerbothner <>1994-04-11 20:26:48 +0000
commitbf04c4a96ab124ba00a25b632c5f2d64199c8302 (patch)
treea7d2d0bb5e6732cd4f6ed01ae4d8431fa0980551 /gcc/scan.c
parent74b8d8f991973e2e7a7820321bf5e5b107258e11 (diff)
Fix line number counting.
Diffstat (limited to 'gcc/scan.c')
-rw-r--r--gcc/scan.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/scan.c b/gcc/scan.c
index 17e9898497f..b6289908191 100644
--- a/gcc/scan.c
+++ b/gcc/scan.c
@@ -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)