+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
/* 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;
/* 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);
}
/* if .lib or .LIB */
- if (strcmp (extp, "lib") == 0 || strcmp (extp, ".LIB") == 0)
+ if (STRCASECMP (extp, ".lib") == 0)
{
dbuf_destroy (&ext);
dbuf_destroy (&path);
}
/** 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)
if (NULL != ext)
{
- int len;
-
- ++p;
- len = end - p;
+ int len = end - p;
if (0 < len)
dbuf_append(ext, p, len);