diff options
author | Jeff Smith <whydoubt@gmail.com> | 2017-04-01 01:18:12 -0500 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2017-05-14 06:31:56 -0400 |
commit | 2c7e34bb958ac5d083b2bab4c89907cd0669196d (patch) | |
tree | 7de07ce7b5d8ca00e632475e11b3ff305138c03b | |
parent | 596a221844c8b13696f83183f44d3fcc7184f464 (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.
-rw-r--r-- | src/filter.c | 2 |
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 */ |