diff --git a/flex/src/buf.c b/flex/src/buf.c index 185083c..8efced7 100644 --- a/flex/src/buf.c +++ b/flex/src/buf.c @@ -95,8 +95,8 @@ struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno) const char *src; size_t tsz; - if (gen_line_dirs) - return buf; + if (!gen_line_dirs) + return buf; tsz = strlen("#line \"\"\n") + /* constant parts */ 2 * strlen (filename) + /* filename with possibly all backslashes escaped */ diff --git a/flex/src/scan.c b/flex/src/scan.c index 445336f..35bb7ed 100644 --- a/flex/src/scan.c +++ b/flex/src/scan.c @@ -2328,7 +2328,8 @@ YY_RULE_SETUP { brace_start_line = linenum; ++linenum; - buf_linedir( &top_buf, infilename?infilename:"", linenum); + if(gen_line_dirs) + buf_linedir(&top_buf, infilename ? infilename : "", linenum); brace_depth = 1; yy_push_state(CODEBLOCK_MATCH_BRACE); } @@ -4478,7 +4479,7 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 1113); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT diff --git a/flex/src/skel.c b/flex/src/skel.c index 0b43266..eaf45e9 100644 --- a/flex/src/skel.c +++ b/flex/src/skel.c @@ -1651,8 +1651,8 @@ const char *skel[] = { " /* Create the reject buffer large enough to save one state per allowed character. */", " if ( ! YY_G(yy_state_buf) )", " YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE M4_YY_CALL_LAST_ARG);", - " if ( ! YY_G(yy_state_buf) )", - " YY_FATAL_ERROR( \"out of dynamic memory in yylex()\" );", + " if ( ! YY_G(yy_state_buf) )", + " YY_FATAL_ERROR( \"out of dynamic memory in yylex()\" );", "]])", "", " if ( ! YY_G(yy_start) )", @@ -2181,7 +2181,7 @@ const char *skel[] = { "%% [17.0] code to find the next state, and perhaps do backing up, goes here", "", " M4_YY_NOOP_GUTS_VAR();", - " return yy_is_jam ? 0 : yy_current_state;", + "return yy_is_jam ? 0 : yy_current_state;", "}", "", "",