- use different names for different AST dumps.

This commit is contained in:
Christoph Oelckers 2016-11-04 10:35:14 +01:00
parent 7068070c0d
commit 07c24c7e27

View file

@ -369,10 +369,10 @@ static void DoParse(int lumpnum)
if (Args->CheckParm("-dumpast"))
{
FString ast = ZCC_PrintAST(state.TopNode);
FString filename = Wads.GetLumpFullName(lumpnum);
FString astfile = ExtractFileBase(filename, false);
astfile << ".ast";
FILE *ff = fopen(astfile, "w");
FString filename = Wads.GetLumpFullPath(lumpnum);
filename.ReplaceChars(":\\/?|", '.');
filename << ".ast";
FILE *ff = fopen(filename, "w");
if (ff != NULL)
{
fputs(ast.GetChars(), ff);