mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
Introduce llvm::sys::path::home_directory.
This will be used by the line editor library to derive a default path to the history file. Differential Revision: http://llvm-reviews.chandlerc.com/D2199 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200594 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user