From: Daniel Dunbar Date: Wed, 18 Mar 2009 09:58:30 +0000 (+0000) Subject: Driver: Bug fix, derived .gch names sometimes started with "/". X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56c5594515571eab0e02368ed05416b9dac20837;p=clang Driver: Bug fix, derived .gch names sometimes started with "/". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67192 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index f2e965c1a7..0cb14886e9 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -820,7 +820,10 @@ const char *Driver::GetNamedOutputPath(Compilation &C, // pathname. if (JA.getType() == types::TY_PCH) { BasePath.eraseComponent(); - BasePath.appendComponent(NamedOutput); + if (BasePath.isEmpty()) + BasePath = NamedOutput; + else + BasePath.appendComponent(NamedOutput); return C.addResultFile(C.getArgs().MakeArgString(BasePath.c_str())); } else { return C.addResultFile(NamedOutput);