Work around a flex limitation with yyrestart()

See the comments added with this patch for more information.
This commit is contained in:
Cary R 2008-08-28 12:07:51 -07:00 committed by Stephen Williams
parent 150d51c19b
commit d15e2a2f73
1 changed files with 6 additions and 0 deletions

View File

@ -1588,6 +1588,12 @@ static int load_next_input()
if(depend_file)
fprintf(depend_file, "%s\n", istack->path);
/* This works around an issue in flex yyrestart() where it
* uses yyin to create a new buffer when one does not exist.
* I would have assumed that it would use the file argument.
* The problem is that we have deleted the buffer and freed
* yyin (isp->file) above. */
yyin = 0;
yyrestart(istack->file);
return 1;
}