From c991d155f4bbfacf7e73080ee93fcaef3d84d3a6 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 20 Oct 2009 04:05:16 +0000 Subject: [PATCH] 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. --- opal/util/path.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opal/util/path.c b/opal/util/path.c index 6dc8e03729..d10a367a12 100644 --- a/opal/util/path.c +++ b/opal/util/path.c @@ -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 */