aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 17d518b..9e43dda 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -549,9 +549,12 @@ const FileEntry *HeaderSearch::LookupFile(
// a subsequent include of "baz.h" should resolve to "whatever/foo/baz.h".
// This search is not done for <> headers.
if (CurFileEnt && !isAngled && !NoCurDirSearch) {
+ SmallString<1024> TmpDir;
// Concatenate the requested file onto the directory.
- SmallString<1024> TmpDir(CurFileEnt->getDir()->getName());
- llvm::sys::path::append(TmpDir, Filename);
+ // FIXME: Portability. Filename concatenation should be in sys::Path.
+ TmpDir += CurFileEnt->getDir()->getName();
+ TmpDir.push_back('/');
+ TmpDir.append(Filename.begin(), Filename.end());
if (const FileEntry *FE = FileMgr.getFile(TmpDir.str(),/*openFile=*/true)) {
// Leave CurDir unset.
// This file is a system header or C++ unfriendly if the old file is.