file preOutName was unlinked before closed. This seems to be OK on UNIX and cygwin
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 10 Aug 2002 15:28:02 +0000 (15:28 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 10 Aug 2002 15:28:02 +0000 (15:28 +0000)
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

index c01f17582860e5948e921eadb609f582077a6d41..506bfb08cd9717ac88d9484c16379713e3e09f1c 100644 (file)
@@ -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;
-
 }