Displaying 1 result from an estimated 1 matches for "requesteddir".
2016 Apr 19
2
llvm::sys::path::home_directory() implementation for unix
I recently was using llvm code from a process that I manually spawned as a child process and noticed that llvm::sys::path::home_directory() only works if "HOME" is set in the process environment:
bool home_directory(SmallVectorImpl<char> &result) {
if (char *RequestedDir = getenv("HOME")) {
result.clear();
result.append(RequestedDir, RequestedDir + strlen(RequestedDir));
return true;
}
return false;
}
This is in lib/Support/Unix/Path.inc. Do we want to try a little bit harder? Maybe something like:
bool home_directory(SmallVectorImpl<...