diff options
author | Victor van den Elzen <victor.vde@gmail.com> | 2008-06-04 15:24:20 +0200 |
---|---|---|
committer | Victor van den Elzen <victor.vde@gmail.com> | 2008-07-16 12:20:23 +0200 |
commit | c82c3724952583a1a8e5546096a59c1b7bca601e (patch) | |
tree | 4d3f9eeb35442a12878eb18d72d7f30229877adc /nasm.c | |
parent | 1b1522fadf6189296e01d6ebc33944c7aa91270a (diff) | |
download | nasm-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.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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); |