* src/SDCCmain.c, src/SDCCutil.c: dbuf_splitFile: file extension
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Jan 2007 16:47:44 +0000 (16:47 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Jan 2007 16:47:44 +0000 (16:47 +0000)
  component contains the extension separator.

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4606 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCmain.c
src/SDCCutil.c

index 9c5b95775bc5e40696472cb23ea0c3a862af9d3a..08425d16c2923336e2fc9ae6547d95449a43c6a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-29 Borut Razem <borut.razem AT siol.net>
+
+       * src/SDCCmain.c, src/SDCCutil.c: dbuf_splitFile: file extension
+         component contains the extension separator.
+
 2007-01-28 Borut Razem <borut.razem AT siol.net>
 
        * sim/ucsim/cmd.src/cmdutil.cc: NUL device is detected as CG_FILE type
index 073e4608bcaa6b2b11a9d1b4b66195d64d7847ed..347c04439fb7016b866f7463bfe5c9204ff90e3c 100644 (file)
@@ -628,7 +628,7 @@ processFile (char *s)
 
   /* otherwise depending on the file type */
   extp = dbuf_c_str (&ext);
-  if (extp[1] == '\0' && (extp[0] == 'c' || extp[0] == 'C'))
+  if (STRCASECMP (extp, ".c") == 0)
     {
       char *p;
 
@@ -674,8 +674,7 @@ processFile (char *s)
 
   /* if the extention is type .rel or .r or .REL or .R
      additional object file will be passed to the linker */
-  if ((extp[1] == '\0' && (extp[0] == 'r' || extp[0] == 'R')) ||
-      strcmp (extp, "rel") == 0 || strcmp (extp, "REL") == 0 ||
+  if (STRCASECMP (extp, ".r") == 0 || STRCASECMP (extp, ".rel") == 0 ||
       strcmp (extp, port->linker.rel_ext) == 0)
     {
       dbuf_destroy (&ext);
@@ -686,7 +685,7 @@ processFile (char *s)
     }
 
   /* if .lib or .LIB */
-  if (strcmp (extp, "lib") == 0 || strcmp (extp, ".LIB") == 0)
+  if (STRCASECMP (extp, ".lib") == 0)
     {
       dbuf_destroy (&ext);
       dbuf_destroy (&path);
index 6673b36378047a3c9882d90c65da99ce795358c1..d34ad73393fa6c7ec71da509ed0db1c7e9b10936 100644 (file)
@@ -158,7 +158,7 @@ dbuf_splitPath(const char *path, struct dbuf_s *dir, struct dbuf_s *file)
 }
 
 /** Split the path string to the file name (including directory) and file extension components.
-    The file name component doesn't contain trailing extension separator.
+    File extension component contains the extension separator.
     Returns true if the path contains the extension separator. */
 int
 dbuf_splitFile(const char *path, struct dbuf_s *file, struct dbuf_s *ext)
@@ -187,10 +187,7 @@ dbuf_splitFile(const char *path, struct dbuf_s *file, struct dbuf_s *ext)
 
       if (NULL != ext)
         {
-          int len;
-
-          ++p;
-          len = end - p;
+          int len = end - p;
 
           if (0 < len)
             dbuf_append(ext, p, len);