* src/SDCCmain.c(parseCmdLine): fixed bug 1677144
authorMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 24 Mar 2007 21:24:54 +0000 (21:24 +0000)
committerMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 24 Mar 2007 21:24:54 +0000 (21:24 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4712 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCmain.c

index f95d560da4b70f72fdb5eafd7dd76d9ba78c1ce1..6fcc787633283566891c64ae63b327c7ac1d54fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
          removed header guard)
        * .version,
        * sdcc.spec: bumped version to 2.6.5
+       * src/SDCCmain.c(parseCmdLine): fixed bug 1677144
 
 2007-03-22 Borut Razem <borut.razem AT siol.net>
 
index 083ecb12557eee763c4e732e733b0800c4af6514..cb082bb14f9e65120d0bb3e72428e8cdf559afaf 100644 (file)
@@ -1405,7 +1405,7 @@ parseCmdLine (int argc, char **argv)
         {
           struct dbuf_s path;
 
-                 if (*dstPath != '\0')
+          if (*dstPath != '\0')
             {
               dbuf_init(&path, 128);
               dbuf_makePath (&path, dstPath, moduleNameBase);
@@ -1422,6 +1422,14 @@ parseCmdLine (int argc, char **argv)
 
           dbuf_init(&file, 128);
 
+          /* get rid of the "."-extension */
+          dbuf_splitFile (s, &file, NULL);
+
+          dbuf_c_str (&file);
+          s = dbuf_detach (&file);
+
+          dbuf_init (&file, 128);
+
           dbuf_splitPath (s, NULL, &file);
 
           if (*dstPath != '\0')
@@ -1490,7 +1498,7 @@ linkEdit (char **envp)
   linkerScriptFileName[0] = 0;
   c = NULL;
 
-  if(port->linker.needLinkerScript)
+  if (port->linker.needLinkerScript)
     {
       char out_fmt;
 
@@ -1510,7 +1518,7 @@ linkEdit (char **envp)
         }
 
       /* first we need to create the <filename>.lnk file */
-      SNPRINTF (linkerScriptFileName, sizeof(scratchFileName),
+      SNPRINTF (linkerScriptFileName, sizeof(linkerScriptFileName),
         "%s.lnk", dstFileName);
       if (!(lnkfile = fopen (linkerScriptFileName, "w")))
         {
@@ -2085,8 +2093,8 @@ preProcess (char **envp)
 
       if (port && port->processor && TARGET_IS_PIC) {
         char proc[512];
-       SNPRINTF(&proc[0], 512, "-DSDCC_PROCESSOR=\"%s\"", port->processor);
-       addSet(&preArgvSet, Safe_strdup(proc));
+        SNPRINTF(&proc[0], 512, "-DSDCC_PROCESSOR=\"%s\"", port->processor);
+        addSet(&preArgvSet, Safe_strdup(proc));
       }
 
       /* standard include path */