summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorVictor van den Elzen <victor.vde@gmail.com>2008-06-04 15:24:20 +0200
committerVictor van den Elzen <victor.vde@gmail.com>2008-07-16 12:20:23 +0200
commitc82c3724952583a1a8e5546096a59c1b7bca601e (patch)
tree4d3f9eeb35442a12878eb18d72d7f30229877adc /nasm.c
parent1b1522fadf6189296e01d6ebc33944c7aa91270a (diff)
downloadnasm-c82c3724952583a1a8e5546096a59c1b7bca601e.tar.gz
nasm-c82c3724952583a1a8e5546096a59c1b7bca601e.tar.bz2
nasm-c82c3724952583a1a8e5546096a59c1b7bca601e.zip
Fix fclose bug on error.
Contrary to the comments, the fclose is needed. Failure to close the file caused remove to fail on Windows.
Diffstat (limited to 'nasm.c')
-rw-r--r--nasm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nasm.c b/nasm.c
index e21d089..66c69bf 100644
--- a/nasm.c
+++ b/nasm.c
@@ -443,11 +443,12 @@ int main(int argc, char **argv)
cleanup_labels();
} else {
/*
- * We had an fclose on the output file here, but we
- * actually do that in all the object file drivers as well,
- * so we're leaving out the one here.
- * fclose (ofile);
+ * Despite earlier comments, we need this fclose.
+ * The object output drivers only fclose on cleanup,
+ * and we just skipped that.
*/
+ fclose (ofile);
+
remove(outname);
if (listname[0])
remove(listname);