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