summaryrefslogtreecommitdiff
path: root/tools/clang-format/ClangFormat.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-05-21 14:21:46 +0000
committerDaniel Jasper <djasper@google.com>2013-05-21 14:21:46 +0000
commit33886c7345397058096697a8a031a688a7bef762 (patch)
treec800dcf4e07561f9e5491c82bf617ff6cd572041 /tools/clang-format/ClangFormat.cpp
parent6bd3b93200c6ae141d0f7444ffb4cacd52b183ed (diff)
downloadclang-33886c7345397058096697a8a031a688a7bef762.tar.gz
clang-33886c7345397058096697a8a031a688a7bef762.tar.bz2
clang-33886c7345397058096697a8a031a688a7bef762.tar.xz
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
Diffstat (limited to 'tools/clang-format/ClangFormat.cpp')
-rw-r--r--tools/clang-format/ClangFormat.cpp2
1 files changed, 1 insertions, 1 deletions
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());