mirror of
https://github.com/darlinghq/cctools-port.git
synced 2024-11-23 12:19:40 +00:00
fix archiver (ar) crash on FreeBSD (looks like a bug in cctools itself)
This commit is contained in:
parent
2f0f00d237
commit
a4141a2e92
@ -161,11 +161,19 @@ char *str)
|
||||
p = allocate(bufsize);
|
||||
_NSGetExecutablePath(p, &bufsize);
|
||||
}
|
||||
prefix = realpath(p, resolved_name);
|
||||
p = rindex(prefix, '/');
|
||||
if(p != NULL)
|
||||
p[1] = '\0';
|
||||
|
||||
if (*p){
|
||||
prefix = realpath(p, resolved_name);
|
||||
if (prefix){
|
||||
p = rindex(prefix, '/');
|
||||
if(p != NULL)
|
||||
p[1] = '\0';
|
||||
} else{
|
||||
goto invalid;
|
||||
}
|
||||
} else{
|
||||
invalid:;
|
||||
prefix = "";
|
||||
}
|
||||
//NOTE, here we add a target alias to command str;
|
||||
return(makestr(prefix, PROGRAM_PREFIX, str, NULL));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user