diff options
-rw-r--r-- | Driver/HTMLDiagnostics.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Driver/HTMLDiagnostics.cpp b/Driver/HTMLDiagnostics.cpp index 93af22376d..a4736950f3 100644 --- a/Driver/HTMLDiagnostics.cpp +++ b/Driver/HTMLDiagnostics.cpp @@ -115,10 +115,18 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) { { std::ostringstream os; + + os << "<h1>"; + const FileEntry* Entry = SMgr.getFileEntryForID(FileID); + const char* dname = Entry->getDir()->getName(); + + if (strcmp(dname,".") == 0) + os << html::EscapeText(llvm::sys::Path::GetCurrentDirectory().toString()); + else + os << html::EscapeText(dname); - os << "<h1>" << html::EscapeText(Entry->getDir()->getName()) - << "/" << html::EscapeText(Entry->getName()) << "</h1>\n"; + os << "/" << html::EscapeText(Entry->getName()) << "</h1>\n"; R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str()); } |