diff options
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index d5260424616..d0b63b5ba5c 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -797,5 +797,20 @@ error_code openFileForWrite(const Twine &Name, int &ResultFD, } } // end namespace fs + +namespace path { + +bool home_directory(SmallVectorImpl<char> &result) { + if (char *RequestedDir = getenv("HOME")) { + result.clear(); + result.append(RequestedDir, RequestedDir + strlen(RequestedDir)); + return true; + } + + return false; +} + +} // end namespace path + } // end namespace sys } // end namespace llvm |