]> granicus.if.org Git - clang/commitdiff
Fix clang-format CLion integration bug.
authorEric Liu <ioeric@google.com>
Thu, 2 Nov 2017 12:48:48 +0000 (12:48 +0000)
committerEric Liu <ioeric@google.com>
Thu, 2 Nov 2017 12:48:48 +0000 (12:48 +0000)
CLion's Sax parser threw this error:

Failed to parse clang-format XML replacements. Input: <?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='true' line=89>
[...]
[org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 66; Open quote is expected for attribute "line" associated with an  element type  "replacements".]

Patch by Justine Tunney (jart@google.com)!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317205 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-format/ClangFormat.cpp

index e169b9e5854a80a27f0597156265be69f18c6fc6..b7179ffd641636e274525f4868ba87c4ef5c963a 100644 (file)
@@ -289,7 +289,7 @@ static bool format(StringRef FileName) {
               "xml:space='preserve' incomplete_format='"
            << (Status.FormatComplete ? "false" : "true") << "'";
     if (!Status.FormatComplete)
-      outs() << " line=" << Status.Line;
+      outs() << " line='" << Status.Line << "'";
     outs() << ">\n";
     if (Cursor.getNumOccurrences() != 0)
       outs() << "<cursor>"