summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buf.c3
-rw-r--r--src/main.c3
2 files changed, 5 insertions, 1 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 */
diff --git a/src/main.c b/src/main.c
index fd06be4..e6ea2ab 100644
--- a/src/main.c
+++ b/src/main.c
@@ -496,7 +496,8 @@ void check_options (void)
m4defs_buf.nelts = 0; /* memory leak here. */
/* Place a bogus line directive, it will be fixed in the filter. */
- outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n");
+ if (gen_line_dirs)
+ outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n");
/* Dump the user defined preproc directives. */
if (userdef_buf.elts)