Fix a bug where we were requiring that all paths in $PATH be absolute. Some users provide relative paths in their environment, and we should respect those.
Этот коммит содержится в:
родитель
163999bce0
Коммит
0e58609327
@ -231,16 +231,18 @@ char *opal_path_access(char *fname, char *path, int mode)
|
|||||||
{
|
{
|
||||||
char *fullpath = NULL;
|
char *fullpath = NULL;
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
bool relative;
|
||||||
|
|
||||||
/* Allocate space for the full pathname. */
|
/* Allocate space for the full pathname. */
|
||||||
if (NULL == path) {
|
if (NULL == path) {
|
||||||
fullpath = opal_os_path(false, fname, NULL);
|
fullpath = opal_os_path(false, fname, NULL);
|
||||||
} else {
|
} else {
|
||||||
fullpath = opal_os_path(false, path, fname, NULL);
|
relative = !opal_path_is_absolute(path);
|
||||||
|
fullpath = opal_os_path(relative, path, fname, NULL);
|
||||||
}
|
}
|
||||||
if (NULL == fullpath)
|
if (NULL == fullpath) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
/* first check to see - is this a file or a directory? We
|
/* first check to see - is this a file or a directory? We
|
||||||
* only want files
|
* only want files
|
||||||
*/
|
*/
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user