summaryrefslogtreecommitdiff
path: root/src/buf.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-02-23 15:59:42 +0100
committerWill Estes <westes575@gmail.com>2016-02-24 16:19:49 -0500
commit647a92b9f4cda774fa9a088701e63bde59f5f684 (patch)
treeae13d6f585896464da6c1f25ebe1e8c587c59045 /src/buf.c
parent64f27743785e30855b486e4575429192fddaa9eb (diff)
Emit no #line directives if gen_line_dirs is false, resolves igh#55.
There are two instances in the code which will print a #line directive to the resulting lexer, regardless of the value of gen_line_dirs. Fix them, so they also respect gen_line_dirs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'src/buf.c')
-rw-r--r--src/buf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/buf.c b/src/buf.c
index 2a423ef..f216b6d 100644
--- a/src/buf.c
+++ b/src/buf.c
@@ -95,6 +95,9 @@ struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
const char *src;
size_t tsz;
+ if (gen_line_dirs)
+ return buf;
+
tsz = strlen("#line \"\"\n") + /* constant parts */
2 * strlen (filename) + /* filename with possibly all backslashes escaped */
(int) (1 + log10 (abs (lineno))) + /* line number */