mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Try reading from /proc/self first on linux, this is needed to make the edgy "make avail" work
This commit is contained in:
parent
d78672a4b4
commit
74f92564c3
@ -296,10 +296,23 @@ void AddSubSearchPathFromBin (SearchPaths* P, const char* SubDir)
|
|||||||
}
|
}
|
||||||
*Ptr = '\0';
|
*Ptr = '\0';
|
||||||
|
|
||||||
|
#elif defined(__linux__)
|
||||||
|
|
||||||
|
/* reading from proc will return the real location, excluding symlinked
|
||||||
|
pathes - which is needed for certain edgy cases */
|
||||||
|
if (readlink("/proc/self/exe", Dir, sizeof(Dir) - 1) < 0) {
|
||||||
|
GetProgPath(Dir, ArgVec[0]);
|
||||||
|
} else {
|
||||||
|
/* Remove binary name */
|
||||||
|
Ptr = strrchr (Dir, PATHSEP[0]);
|
||||||
|
if (Ptr == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*Ptr = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
GetProgPath(Dir, ArgVec[0]);
|
GetProgPath(Dir, ArgVec[0]);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check for 'bin' directory */
|
/* Check for 'bin' directory */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user