diff options
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r-- | lib/Support/Unix/Path.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index f295b92e4a..a139399cba 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -251,9 +251,12 @@ Path::GetUserHomeDirectory() { Path Path::GetCurrentDirectory() { + if (char *pwd = getenv("PWD")) + return Path(pwd); + char pathname[MAXPATHLEN]; - if (!getcwd(pathname,MAXPATHLEN)) { - assert (false && "Could not query current working directory."); + if (!getcwd(pathname, MAXPATHLEN)) { + assert(false && "Could not query current working directory."); return Path(); } |