diff --git a/src/scconf/lex-parse.l b/src/scconf/lex-parse.l index f531db97..198ca9ce 100644 --- a/src/scconf/lex-parse.l +++ b/src/scconf/lex-parse.l @@ -59,9 +59,14 @@ int scconf_lex_parse(scconf_parser *p, const char *filename) return 0; yylex(); -#if 0 - yy_delete_buffer(yy_current_buffer); - yy_current_buffer = NULL; +#if 1 + /* For non-reentrant C scanner only. */ + if (yy_current_buffer) { + yy_delete_buffer(yy_current_buffer); + yy_current_buffer = NULL; + yy_init = 1; + yy_start = 0; + } #endif fclose(yyin); return 1;