- strncpyz(scratchFileName, prel, PATH_MAX);
- /* Strip off the /sdcc at the end */
- *strrchr(scratchFileName, DIR_SEPARATOR_CHAR) = '\0';
- /* Compute what the difference between the prefix and the bin dir
- should be. */
- getPathDifference (buffer, PREFIX, BINDIR);
-
- /* Verify that the path in has the expected suffix */
- if (strlen(buffer) > strlen(scratchFileName))
- {
- /* Not long enough */
- return NULL;
- }
-
- if (pathEquivalent (buffer, scratchFileName + strlen(scratchFileName) - strlen(buffer)) == FALSE)
- {
- /* Doesn't match */
+ char *p;
+ size_t len;
+ static char path[PATH_MAX];
+
+ if ((p = strrchr(prel, DIR_SEPARATOR_CHAR)) == NULL)
+#ifdef _WIN32
+ /* try *nix dir separator on WIN32 */
+ if ((p = strrchr(prel, UNIX_DIR_SEPARATOR_CHAR)) == NULL)
+#endif