mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
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:
parent
1b1522fadf
commit
c82c372495
9
nasm.c
9
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);
|
||||
|
Loading…
Reference in New Issue
Block a user