X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/be2a1a68efe93f7046f77b81346e4c740c14fb40..969e2ed98b6b66e1fa2d1e23247644d2057995d9:/src/scan-skel.l diff --git a/src/scan-skel.l b/src/scan-skel.l index 82f9ed1a..9a01ffef 100644 --- a/src/scan-skel.l +++ b/src/scan-skel.l @@ -26,16 +26,20 @@ #include "files.h" int skel_lex PARAMS ((void)); static int yylineno = 1; +static char *yyoutname = NULL; %} %% /* This is an approximation, but we don't need more. */ ^"#output \""[^\"]+\"\n { yytext[yyleng - 2] = '\0'; - skel_out = xfopen (yytext + strlen ("#output \""), "w"); + XFREE (yyoutname); + yyoutname = xstrdup (yytext + strlen ("#output \"")); + yyout = xfopen (yyoutname, "w"); yylineno = 1; } "__oline__" fprintf (yyout, "%d", yylineno); +"__ofile__" fprintf (yyout, "%s", yyoutname); [^_\n]+ ECHO; \n+ yylineno += yyleng; ECHO; . ECHO;