@ -483,7 +483,7 @@ retry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((sb.st_mode & S_IFMT) == S_IFLNK) {
|
if ((sb.st_mode & S_IFMT) == S_IFLNK) {
|
||||||
char *link_path = malloc(max_len);
|
link_path = malloc(max_len);
|
||||||
if (!link_path) {
|
if (!link_path) {
|
||||||
fprintf(stderr, "lookup_exec_path(): error allocating\n");
|
fprintf(stderr, "lookup_exec_path(): error allocating\n");
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
@ -498,6 +498,14 @@ retry:
|
|||||||
|
|
||||||
__dprintf("lookup_exec_path(): %s is link -> %s\n", path, link_path);
|
__dprintf("lookup_exec_path(): %s is link -> %s\n", path, link_path);
|
||||||
|
|
||||||
|
if(link_path[0] != '/'){
|
||||||
|
char *t = strrchr(path, '/');
|
||||||
|
if(t){
|
||||||
|
t++;
|
||||||
|
strcpy(t, link_path);
|
||||||
|
strcpy(link_path, path);
|
||||||
|
}
|
||||||
|
}
|
||||||
filename = link_path;
|
filename = link_path;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user