path: root/src
diff options
authorJeff Smith <>2017-04-01 01:18:12 -0500
committerWill Estes <>2017-05-14 06:31:56 -0400
commit2c7e34bb958ac5d083b2bab4c89907cd0669196d (patch)
tree7de07ce7b5d8ca00e632475e11b3ff305138c03b /src
parent596a221844c8b13696f83183f44d3fcc7184f464 (diff)
filter: Output correct #line value for current file.
A #line pre-processor directive specifies the line number and source file of the following lines. If the source file _is_ the current file, the line number should be that of the line following the directive. So the specified line number should be the current line number plus 1.
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filter.c b/src/filter.c
index 71f3635..ed3bfe3 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -391,7 +391,7 @@ int filter_fix_linedirs (struct filter *chain)
/* Adjust the line directives. */
in_gen = true;
snprintf (buf, readsz, "#line %d \"%s\"\n",
- lineno, filename);
+ lineno + 1, filename);
else {
/* it's a #line directive for code we didn't write */