From: Daniel Jasper Date: Tue, 21 May 2013 14:21:46 +0000 (+0000) Subject: Fix behavior of clang-format's -cursor flag. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33886c7345397058096697a8a031a688a7bef762;p=clang Fix behavior of clang-format's -cursor flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182386 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/clang-format/ClangFormat.cpp b/tools/clang-format/ClangFormat.cpp index 340ef5587f..764200308d 100644 --- a/tools/clang-format/ClangFormat.cpp +++ b/tools/clang-format/ClangFormat.cpp @@ -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());