From abce6b7c692cd72c6ad463fd1dfc421b8d789a98 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Tue, 10 Dec 2013 01:36:10 +0000 Subject: [PATCH] Use llvm::sys::path::append to concatenate paths git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196859 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/HeaderSearch.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp index 9e43dda226..17d518b8d8 100644 --- a/lib/Lex/HeaderSearch.cpp +++ b/lib/Lex/HeaderSearch.cpp @@ -549,12 +549,9 @@ 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. - // FIXME: Portability. Filename concatenation should be in sys::Path. - TmpDir += CurFileEnt->getDir()->getName(); - TmpDir.push_back('/'); - TmpDir.append(Filename.begin(), Filename.end()); + SmallString<1024> TmpDir(CurFileEnt->getDir()->getName()); + llvm::sys::path::append(TmpDir, Filename); 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. -- 2.40.0