summaryrefslogtreecommitdiff
path: root/gcc/scan.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-04-11 21:26:48 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-04-11 21:26:48 +0000
commit6799cb27144caa2a3277a98979fa0bc737dfb386 (patch)
treea7d2d0bb5e6732cd4f6ed01ae4d8431fa0980551 /gcc/scan.c
parent0daa40e5f86896da1d97ae0ce1f4530976996eee (diff)
downloadgcc-6799cb27144caa2a3277a98979fa0bc737dfb386.tar.gz
Fix line number counting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7036 138bc75d-0d04-0410-961f-82ee72b054a4
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)