Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't emit empty tags

  • Loading branch information...
commit dbb9971b7190031af38c30207851670b1bb08080 1 parent 1cbcf71
@nickg authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 clang-tags.c
View
11 clang-tags.c
@@ -116,10 +116,13 @@ static enum CXChildVisitResult cursor_visitor(CXCursor cursor,
CXString file_str = clang_getFileName(file);
CXString str = clang_getCursorSpelling(cursor);
- printf("visit: %s: line %u col %u off %u: %s\n",
- clang_getCString(file_str), line, column, offset,
- clang_getCString(str));
- emit_tag(clang_getCString(str), search, line, offset);
+
+ if (clang_getCString(str)[0] != '\0') {
+ printf("visit: %s: line %u col %u off %u: %s\n",
+ clang_getCString(file_str), line, column, offset,
+ clang_getCString(str));
+ emit_tag(clang_getCString(str), search, line, offset);
+ }
clang_disposeString(str);
clang_disposeString(file_str);
Please sign in to comment.
Something went wrong with that request. Please try again.