aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-03-27 17:25:28 +0000
committerTed Kremenek <kremenek@apple.com>2008-03-27 17:25:28 +0000
commit5d0f592b9d435484893c38855df8dbbd000d2d13 (patch)
treead9b3237e25b1d53640d29bc6bd7a480b311030e
parentbc8e016aed1782daf252a3a65147449e24034d0f (diff)
For HTMLDiagnostics, when emitting the name of the directory, substitute the current working directory for "."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48888 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Driver/HTMLDiagnostics.cpp12
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());
}