From 2c7e34bb958ac5d083b2bab4c89907cd0669196d Mon Sep 17 00:00:00 2001
From: Jeff Smith <whydoubt@gmail.com>
Date: Sat, 1 Apr 2017 01:18:12 -0500
Subject: [PATCH] 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.
---
 src/filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
-- 
1.8.3.1

