]> granicus.if.org Git - clang/commitdiff
Fix behavior of clang-format's -cursor flag.
authorDaniel Jasper <djasper@google.com>
Tue, 21 May 2013 14:21:46 +0000 (14:21 +0000)
committerDaniel Jasper <djasper@google.com>
Tue, 21 May 2013 14:21:46 +0000 (14:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182386 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-format/ClangFormat.cpp

index 340ef5587ff9263957824eb1fd515b83dade7af6..764200308d063eb7660052d9835763f0f7ccaccd 100644 (file)
@@ -226,7 +226,7 @@ static bool format(std::string FileName) {
       Rewrite.getEditBuffer(ID).write(FileStream);
       FileStream.flush();
     } else {
-      if (Cursor != 0)
+      if (Cursor.getNumOccurrences() != 0)
         outs() << "{ \"Cursor\": " << tooling::shiftedCodePosition(
                                           Replaces, Cursor) << " }\n";
       Rewrite.getEditBuffer(ID).write(outs());