mirror of https://github.com/python/cpython
When following symlinks to the real executable, use a loop so a
symlink to a symlink can work. (Jack)
This commit is contained in:
parent
91eeefdee4
commit
302be44e96
|
@ -437,7 +437,7 @@ calculate_path()
|
|||
{
|
||||
char tmpbuffer[MAXPATHLEN+1];
|
||||
int linklen = readlink(progpath, tmpbuffer, MAXPATHLEN);
|
||||
if (linklen != -1) {
|
||||
while (linklen != -1) {
|
||||
/* It's not null terminated! */
|
||||
tmpbuffer[linklen] = '\0';
|
||||
if (tmpbuffer[0] == SEP)
|
||||
|
@ -447,6 +447,7 @@ calculate_path()
|
|||
reduce(argv0_path);
|
||||
joinpath(argv0_path, tmpbuffer);
|
||||
}
|
||||
linklen = readlink(argv0_path, tmpbuffer, MAXPATHLEN);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_READLINK */
|
||||
|
|
Loading…
Reference in New Issue