-/** Given a file with path information in the binary files directory,
- returns what PREFIX must be to get this path. Used for discovery
- of where SDCC is installed. Returns NULL if the path is
- impossible.
-*/
-char *
-getPrefixFromBinPath (const char *prel)
-{
- 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;