From c5fba2c56a20411a7705af8e430213fcdeb0d077 Mon Sep 17 00:00:00 2001 From: borutr Date: Sat, 10 Aug 2002 15:28:02 +0000 Subject: [PATCH] file preOutName was unlinked before closed. This seems to be OK on UNIX and cygwin platforms, but it doesn't work with Visual Studio: the opened file can not be removed. The consequence was that some temporary files were not removed. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2067 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCmain.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/SDCCmain.c b/src/SDCCmain.c index c01f1758..506bfb08 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -1683,6 +1683,9 @@ main (int argc, char **argv, char **envp) if (cdbFile) fclose (cdbFile); + if (yyin && yyin != stdin) + fclose (yyin); + if (preOutName && !options.c1mode) { unlink (preOutName); @@ -1701,9 +1704,5 @@ main (int argc, char **argv, char **envp) linkEdit (envp); } - if (yyin && yyin != stdin) - fclose (yyin); - return 0; - } -- 2.30.2