X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=ftepp.c;h=10c945ecd9a666c030ee454792483e7978f3b30b;hb=3c212c8389318db13c536fe85a29dad11633522c;hp=6d5026479807434c98e0af53ec52ea8c3428bad7;hpb=3567abbd64d4cb5a0db5e434955c83a924635d6f;p=xonotic%2Fgmqcc.git diff --git a/ftepp.c b/ftepp.c index 6d50264..10c945e 100644 --- a/ftepp.c +++ b/ftepp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 + * Copyright (C) 2012, 2013 * Wolfgang Bumiller * Dale Weiler * @@ -234,6 +234,7 @@ static ftepp_t* ftepp_new() static void ftepp_delete(ftepp_t *self) { size_t i; + ftepp_flush(self); if (self->itemname) mem_d(self->itemname); if (self->includename) @@ -646,13 +647,18 @@ static bool ftepp_macro_expand(ftepp_t *ftepp, ppmacro *macro, macroparam *param goto cleanup; } ftepp->output_string = old_string; + inlex->line = ftepp->lex->line; + inlex->sline = ftepp->lex->sline; ftepp->lex = inlex; ftepp_recursion_header(ftepp); if (!ftepp_preprocess(ftepp)) { + vec_free(ftepp->lex->open_string); + old_string = ftepp->output_string; lex_close(ftepp->lex); retval = false; goto cleanup; } + vec_free(ftepp->lex->open_string); ftepp_recursion_footer(ftepp); old_string = ftepp->output_string;