From 269c992d9f73f235c7fa65d25162a3e479d6ce4a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 22 Sep 2006 05:28:12 +0000 Subject: [PATCH] Fix NASM preprocessor outputting %line for every line. Noticed by: Dancie Reeves svn path=/trunk/yasm/; revision=1630 --- modules/preprocs/nasm/nasm-preproc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 253aebbb..b0f8a2eb 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -151,7 +151,10 @@ nasm_preproc_create(FILE *f, const char *in_filename, yasm_linemap *lm, static void nasm_preproc_destroy(yasm_preproc *preproc) { + yasm_preproc_nasm *preproc_nasm = (yasm_preproc_nasm *)preproc; nasmpp.cleanup(0); + if (preproc_nasm->file_name) + yasm_xfree(preproc_nasm->file_name); yasm_xfree(preproc); if (preproc_deps) yasm_xfree(preproc_deps); @@ -190,10 +193,6 @@ nasm_preproc_input(yasm_preproc *preproc, char *buf, size_t max_size) } preproc_nasm->prior_linnum = linnum; } - if (preproc_nasm->file_name) { - yasm_xfree(preproc_nasm->file_name); - preproc_nasm->file_name = NULL; - } } n = preproc_nasm->lineleftlineleft:max_size; -- 2.40.0