diff options
Diffstat (limited to 'src/cpp-flex.skl')
-rw-r--r-- | src/cpp-flex.skl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cpp-flex.skl b/src/cpp-flex.skl index 5af5003..32bedfc 100644 --- a/src/cpp-flex.skl +++ b/src/cpp-flex.skl @@ -3060,7 +3060,17 @@ m4_ifdef([[M4_MODE_C_ONLY]], [[ m4_ifdef([[M4_MODE_CXX_ONLY]], [[ b->yy_input_file = file.rdbuf(); ]]) - b->yy_fill_buffer = 1; + + /* b->yy_input_file should never by NULL but we'll handle it cleanly + * on the off chance. + */ + if (b->yy_input_file == NULL){ + b->yy_fill_buffer = 0; + } else { + b->yy_fill_buffer = 1; + } + + /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. |