From: NAKAMURA Takumi Date: Tue, 10 Dec 2013 02:36:28 +0000 (+0000) Subject: Revert r196859, "Use llvm::sys::path::append to concatenate paths", to appease FileMa... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8356608d43f0bc40f235cfedd82feed0741c9aad;p=clang Revert r196859, "Use llvm::sys::path::append to concatenate paths", to appease FileManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196865 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp index 17d518b8d8..9e43dda226 100644 --- a/lib/Lex/HeaderSearch.cpp +++ b/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.