diff --git a/src/lexer.l b/src/lexer.l index 6c1e70b..c564f80 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -221,7 +221,7 @@ static YY_BUFFER_STATE string_scan_state = 0; } <> { - if( string_scan_state != 0 || cfg_include_stack_ptr <= 0 ) + if( cfg_include_stack_ptr <= 0 ) { return EOF; } @@ -336,7 +336,8 @@ void cfg_scan_string_end(void) /* restore to previous state */ yy_delete_buffer(string_scan_state); - yy_switch_to_buffer(pre_string_scan_state); + if (pre_string_scan_state) + yy_switch_to_buffer(pre_string_scan_state); free(cfg_qstring); cfg_qstring = 0; qstring_index = qstring_len = 0;