src/SDCCmain.c (preProcess): minor cleanup: eliminate preOutName
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 11 Mar 2003 00:08:40 +0000 (00:08 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 11 Mar 2003 00:08:40 +0000 (00:08 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2371 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCmain.c

index d23d0f1dc0823089f6c9d7a39c9f282224292509..3b36a3418961f5bc4590b977484fc47447efd096 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2003-03-11  Bernhard Held <bernhard@bernhardheld.de>
 
         * src/SDCCloop.c (mergeRegions): an evil beast is dead
+       * src/SDCCmain.c (preProcess): minor cleanup: eliminate preOutName
 
 2003-03-10  Borut Razem <borut.razem@siol.net>
 
index 5fd4cf0a7892d6de20777f380b0c64ecdfcf49e9..308175e216eb28a4500b6d638e7e0b7e29ae43a6 100644 (file)
@@ -76,7 +76,6 @@ char *libPaths[128];
 int nlibPaths = 0;
 char *relFiles[128];
 int nrelFiles = 0;
-static char *preOutName;
 
 /* uncomment JAMIN_DS390 to always override and use ds390 port
   for mcs51 work.  This is temporary, for compatibility testing. */
@@ -1606,16 +1605,16 @@ preProcess (char **envp)
 
       setMainValue ("cppextraopts", join(preArgv));
 
-      if (preProcOnly)
-        {
-          if (fullDstFileName)
-           {
-              preOutName = Safe_strdup (fullDstFileName);
-           }
-        }
-
-      /* Have to set cppoutfilename to something, even if just pre-processing. */
-      setMainValue ("cppoutfilename", preOutName ? preOutName : "");
+      if (preProcOnly && fullDstFileName)
+       {
+         /* -E and -o given */
+         setMainValue ("cppoutfilename", fullDstFileName);
+       }
+      else
+       {
+         /* Have to set cppoutfilename to something, even if piping */
+         setMainValue ("cppoutfilename", "");
+       }
 
       if (options.verbose)
        printf ("sdcc: Calling preprocessor...\n");