summaryrefslogtreecommitdiffhomepage
path: root/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lexer.c b/lexer.c
index 0fbea79..6e1dcd9 100644
--- a/lexer.c
+++ b/lexer.c
@@ -663,8 +663,8 @@ parse_regexp(uc_lexer *lex)
case UT_LEX_PARSE_REGEX_FLAGS:
rv = (uc_token *)lex->lookbehind;
- while (lex->bufstart < lex->bufend) {
- switch (lex->bufstart[0]) {
+ while (lex->bufstart < lex->bufend || lex->eof) {
+ switch (lex->eof ? EOF : lex->bufstart[0]) {
case 'g':
buf_consume(lex, 1);
is_reg_global = true;