diff options
Diffstat (limited to 'lib/Basic/FileManager.cpp')
-rw-r--r-- | lib/Basic/FileManager.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index 488d4c3b8d..921778d7d1 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -392,10 +392,11 @@ FileManager::getVirtualFile(llvm::StringRef Filename, off_t Size, void FileManager::FixupRelativePath(llvm::sys::Path &path, const FileSystemOptions &FSOpts) { - if (FSOpts.WorkingDir.empty() || path.isAbsolute()) return; - - llvm::sys::Path NewPath(FSOpts.WorkingDir); - NewPath.appendComponent(path.str()); + if (FSOpts.WorkingDir.empty() || llvm::sys::path::is_absolute(path.str())) + return; + + llvm::SmallString<128> NewPath(FSOpts.WorkingDir); + llvm::sys::path::append(NewPath, path.str()); path = NewPath; } |