Fix a minor omission in opal/util/path. If someone provides a relative path to the current working directory, without starting it with a
'.', we should still find the executable - it is in a directory beneath us. In other words, if someone gives us "foo/bar" instead of "./foo/bar", we should still be able to find bar This commit was SVN r22110.
Этот коммит содержится в:
родитель
3a2f071018
Коммит
c991d155f4
@ -326,11 +326,13 @@ static char *list_env_get(char *var, char **list)
|
||||
char* opal_find_absolute_path( char* app_name )
|
||||
{
|
||||
char* abs_app_name;
|
||||
char cwd[OPAL_PATH_MAX], *pcwd;
|
||||
|
||||
if( opal_path_is_absolute(app_name) ) { /* already absolute path */
|
||||
abs_app_name = app_name;
|
||||
} else if( '.' == app_name[0] ) { /* the app is in the current directory */
|
||||
char cwd[OPAL_PATH_MAX], *pcwd;
|
||||
} else if ( '.' == app_name[0] ||
|
||||
NULL != strchr(app_name, OPAL_PATH_SEP[0])) {
|
||||
/* the app is in the current directory or below it */
|
||||
pcwd = getcwd( cwd, OPAL_PATH_MAX );
|
||||
if( NULL == pcwd ) {
|
||||
/* too bad there is no way we can get the app absolute name */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user