diff options
author | Joseph Langley <mightyjo@gmail.com> | 2022-05-16 20:07:33 -0400 |
---|---|---|
committer | Joseph Langley <mightyjo@gmail.com> | 2022-05-18 11:15:49 -0400 |
commit | 4581eccf1e9cb5c2b0646854a5b5b2024c4b602b (patch) | |
tree | d01afe4db5c2ad3b0a1f636006b78915de1e1a98 /src/go-flex.skl | |
parent | 9d9a039c31d1159fca492bf770403deef4c05cd2 (diff) | |
download | flex-git-4581eccf1e9cb5c2b0646854a5b5b2024c4b602b.tar.gz |
fix(issue-525): Fail gracefully when yy_get_next_buffer can't find one.
Demonstrate yyinput() error checking for this condition.
Diffstat (limited to 'src/go-flex.skl')
-rw-r--r-- | src/go-flex.skl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/go-flex.skl b/src/go-flex.skl index 9597a91..e231942 100644 --- a/src/go-flex.skl +++ b/src/go-flex.skl @@ -621,7 +621,11 @@ static void yy_init_buffer(yybuffer b, FILE * file, FlexLexer *yyscanner) yy_flush_buffer(b, yyscanner); b->yyInputFile = file; - b->yyFillBuffer = true; + if (b->yyInputFile == NULL) { + b->yyFillBuffer = false; + } else { + b->yyFillBuffer = true; + } /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. |