]> granicus.if.org Git - clang/commitdiff
For HTMLDiagnostics, when emitting the name of the directory, substitute the current...
authorTed Kremenek <kremenek@apple.com>
Thu, 27 Mar 2008 17:25:28 +0000 (17:25 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 27 Mar 2008 17:25:28 +0000 (17:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48888 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/HTMLDiagnostics.cpp

index 93af22376d424385eca26fc50e0460e4bafdd5f4..a4736950f335261424bb4de89ba2f3d8cfecc018 100644 (file)
@@ -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());
   }