diff --git a/Foundation/src/Path_UNIX.cpp b/Foundation/src/Path_UNIX.cpp index 50d7cda43..6861e0a2c 100644 --- a/Foundation/src/Path_UNIX.cpp +++ b/Foundation/src/Path_UNIX.cpp @@ -204,7 +204,19 @@ std::string PathImpl::expandImpl(const std::string& path) ++it; if (it != end && *it == '/') { - result += homeImpl(); ++it; + const char* homeEnv = getenv("HOME"); + if (homeEnv) + { + result += homeEnv; + std::string::size_type resultSize = result.size(); + if (resultSize > 0 && result[resultSize - 1] != '/') + result.append("/"); + } + else + { + result += homeImpl(); + } + ++it; } else result += '~'; }