]> granicus.if.org Git - clang/commitdiff
Revert r196859, "Use llvm::sys::path::append to concatenate paths", to appease FileMa...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 10 Dec 2013 02:36:28 +0000 (02:36 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 10 Dec 2013 02:36:28 +0000 (02:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196865 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/HeaderSearch.cpp

index 17d518b8d85b8bfc1835b2cd0d3dae8a5060e397..9e43dda226bf47837fcb402cca677479f0b958ca 100644 (file)
@@ -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.