Fix fclose bug on error.

Contrary to the comments, the fclose is needed.
Failure to close the file caused remove to fail on Windows.
This commit is contained in:
Victor van den Elzen 2008-06-04 15:24:20 +02:00
parent 1b1522fadf
commit c82c372495

9
nasm.c
View File

@ -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);