]> granicus.if.org Git - yasm/commitdiff
Fix NASM preprocessor outputting %line for every line.
authorPeter Johnson <peter@tortall.net>
Fri, 22 Sep 2006 05:28:12 +0000 (05:28 -0000)
committerPeter Johnson <peter@tortall.net>
Fri, 22 Sep 2006 05:28:12 +0000 (05:28 -0000)
Noticed by: Dancie Reeves <danny_reeves@hotmail.com>

svn path=/trunk/yasm/; revision=1630

modules/preprocs/nasm/nasm-preproc.c

index 253aebbbe6f94da765e4da53da2cf02e6111b2cd..b0f8a2eb570ae391c6d71a2891ac2a03b7c9c495 100644 (file)
@@ -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->lineleft<max_size?preproc_nasm->lineleft:max_size;